Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 724779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:15:44+00:00 2026-05-14T06:15:44+00:00

This is kind of a oddball problem so I will try to describe the

  • 0

This is kind of a oddball problem so I will try to describe the best that I can.
I have a DataGridView that shows a list of contracts and various pieces of information about them. There are three view modes: Contract Approval, Pre-Production, and Production. Each mode has it’s own set of columns that need to be displayed.

What I have been doing is I have three radio buttons one for each contract style. all of them fire their check changed on this function

private void rbContracts_CheckedChanged(object sender, EventArgs e)
{
    dgvContracts.Columns.Clear();
    if (((RadioButton)sender).Checked == true)
    {
        if (sender == rbPreProduction)
        {
            dgvContracts.Columns.AddRange(searchSettings.GetPreProductionColumns());
            this.contractsBindingSource.DataMember = "Preproduction";
            this.preproductionTableAdapter.Fill(this.searchDialogDataSet.Preproduction);
        }
        else if (sender == rbProduction)
        {
            dgvContracts.Columns.AddRange(searchSettings.GetProductionColumns());
            this.contractsBindingSource.DataMember = "Production";
            this.productionTableAdapter.Fill(this.searchDialogDataSet.Production);

        }
        else if (sender == rbContracts)
        {
            dgvContracts.Columns.AddRange(searchSettings.GetContractsColumns());
            this.contractsBindingSource.DataMember = "Contracts";
            this.contractsTableAdapter.Fill(this.searchDialogDataSet.Contracts);
        }
    }
}

Here is the GetxxxColumns function

public DataGridViewColumn[] GetPreProductionColumns()
{
    this.dgvTxtPreAccount.Visible = DgvTxtPreAccountVisable;
    this.dgvTxtPreImpromedAccNum.Visible = DgvTxtPreImpromedAccNumVisable;
    this.dgvTxtPreCreateDate.Visible = DgvTxtPreCreateDateVisable;
    this.dgvTxtPreCurrentSoftware.Visible = DgvTxtPreCurrentSoftwareVisable;
    this.dgvTxtPreConversionRequired.Visible = DgvTxtPreConversionRequiredVisable;
    this.dgvTxtPreConversionLevel.Visible = DgvTxtPreConversionLevelVisable;
    this.dgvTxtPreProgrammer.Visible = DgvTxtPreProgrammerVisable;
    this.dgvCbxPreEdge.Visible = DgvCbxPreEdgeVisable;
    this.dgvCbxPreEducationRequired.Visible = DgvCbxPreEducationRequiredVisable;
    this.dgvTxtPreTargetMonth.Visible = DgvTxtPreTargetMonthVisable;
    this.dgvCbxPreEdgeDatesDate.Visible = DgvCbxPreEdgeDatesDateVisable;
    this.dgvTxtPreStartDate.Visible = DgvTxtPreStartDateVisable;
    this.dgvTxtPreUserName.Visible = DgvTxtPreUserNameVisable;
    this.dgvCbxPreProductionId.Visible = DgvCbxPreProductionIdVisable;
    return new System.Windows.Forms.DataGridViewColumn[] {
                                                this.dgvTxtPreAccount,
                                                this.dgvTxtPreImpromedAccNum,
                                                this.dgvTxtPreCreateDate,
                                                this.dgvTxtPreCurrentSoftware,
                                                this.dgvTxtPreConversionRequired,
                                                this.dgvTxtPreConversionLevel,
                                                this.dgvTxtPreProgrammer,
                                                this.dgvCbxPreEdge,
                                                this.dgvCbxPreEducationRequired,
                                                this.dgvTxtPreTargetMonth,
                                                this.dgvCbxPreEdgeDatesDate,
                                                this.dgvTxtPreStartDate,
                                                this.dgvTxtPreUserName,
                                                this.dgvCbxPreProductionId,
                                                this.dgvTxtCmnHold,
                                                this.dgvTxtCmnConcern,
                                                this.dgvTxtCmnAccuracyStatus,
                                                this.dgvTxtCmnEconomicStatus,
                                                this.dgvTxtCmnSoftwareStatus,
                                                this.dgvTxtCmnServiceStatus,
                                                this.dgvTxtCmnHardwareStatus,
                                                this.dgvTxtCmnAncillaryStatus,
                                                this.dgvTxtCmnFlowStatus,
                                                this.dgvTxtCmnImpromedAccountNum,
                                                this.dgvTxtCmnOpportunityId};
}
public DataGridViewColumn[] GetProductionColumns()
{
    this.dgvcTxtProAccount.Visible = DgvTxtProAccountVisable;
    this.dgvTxtProImpromedAccNum.Visible = DgvTxtProImpromedAccNumVisable;
    this.dgvTxtProCreateDate.Visible = DgvTxtProCreateDateVisable;
    this.dgvTxtProConvRequired.Visible = DgvTxtProConvRequiredVisable;
    this.dgvTxtProEdgeRequired.Visible = DgvTxtProEdgeRequiredVisable;
    this.dgvTxtProStartDate.Visible = DgvTxtProStartDateVisable;
    this.dgvTxtProHardwareRequired.Visible = DgvTxtProHardwareReqiredVisable;
    this.dgvTxtProStandardDate.Visible = DgvTxtProStandardDateVisable;
    this.dgvTxtProSystemScheduleDate.Visible = DgvTxtProSystemScheduleDateVisable;
    this.dgvTxtProHwSystemCompleteDate.Visible = DgvTxtProHwSystemCompleteDateVisable;
    this.dgvTxtProHardwareTechnician.Visible = DgvTxtProHardwareTechnicianVisable;
    return new System.Windows.Forms.DataGridViewColumn[] {
                                    this.dgvcTxtProAccount,
                                    this.dgvTxtProImpromedAccNum,
                                    this.dgvTxtProCreateDate,
                                    this.dgvTxtProConvRequired,
                                    this.dgvTxtProEdgeRequired,
                                    this.dgvTxtProStartDate,
                                    this.dgvTxtProHardwareRequired,
                                    this.dgvTxtProStandardDate,
                                    this.dgvTxtProSystemScheduleDate,
                                    this.dgvTxtProHwSystemCompleteDate,
                                    this.dgvTxtProHardwareTechnician,
                                    this.dgvTxtCmnHold,
                                    this.dgvTxtCmnConcern,
                                    this.dgvTxtCmnAccuracyStatus,
                                    this.dgvTxtCmnEconomicStatus,
                                    this.dgvTxtCmnSoftwareStatus,
                                    this.dgvTxtCmnServiceStatus,
                                    this.dgvTxtCmnHardwareStatus,
                                    this.dgvTxtCmnAncillaryStatus,
                                    this.dgvTxtCmnFlowStatus,
                                    this.dgvTxtCmnImpromedAccountNum,
                                    this.dgvTxtCmnOpportunityId};
}
public DataGridViewColumn[] GetContractsColumns()
{
    this.dgvTxtConAccount.Visible = this.DgvTxtConAccountVisable;
    this.dgvTxtConAccuracyStatus.Visible = this.DgvTxtConAccuracyStatusVisable;
    this.dgvTxtConCreateDate.Visible = this.DgvTxtConCreateDateVisable;
    this.dgvTxtConEconomicStatus.Visible = this.DgvTxtConEconomicStatusVisable;
    this.dgvTxtConHardwareStatus.Visible = this.DgvTxtConHardwareStatusVisable;
    this.dgvTxtConImpromedAccNum.Visible = this.DgvTxtConImpromedAccNumVisable;
    this.dgvTxtConServiceStatus.Visible = this.DgvTxtConServiceStatusVisable;
    this.dgvTxtConSoftwareStatus.Visible = this.DgvTxtConSoftwareStatusVisable;
    this.dgvCbxConPreProductionId.Visible = this.DgvCbxConPreProductionIdVisable;
    this.dgvCbxConProductionId.Visible = this.DgvCbxConProductionVisable;
    return new System.Windows.Forms.DataGridViewColumn[] {
                                    this.dgvTxtConAccount,
                                    this.dgvTxtConImpromedAccNum,
                                    this.dgvTxtConCreateDate,
                                    this.dgvTxtConAccuracyStatus,
                                    this.dgvTxtConEconomicStatus,
                                    this.dgvTxtConSoftwareStatus,
                                    this.dgvTxtConServiceStatus,
                                    this.dgvTxtConHardwareStatus,
                                    this.dgvCbxConPreProductionId,
                                    this.dgvCbxConProductionId,
                                    this.dgvTxtCmnHold,
                                    this.dgvTxtCmnConcern,
                                    this.dgvTxtCmnAccuracyStatus,
                                    this.dgvTxtCmnEconomicStatus,
                                    this.dgvTxtCmnSoftwareStatus,
                                    this.dgvTxtCmnServiceStatus,
                                    this.dgvTxtCmnHardwareStatus,
                                    this.dgvTxtCmnAncillaryStatus,
                                    this.dgvTxtCmnFlowStatus,
                                    this.dgvTxtCmnImpromedAccountNum,
                                    this.dgvTxtCmnOpportunityId};
}

The issue is when I check a button the first time, everything shows up ok. I choose another view, everything is ok. But when I click on the first view the columns are out of order (it is like they are in reverse order but it is not exactly the same). this happens only to the first page you click on, the other two are fine. You can click off and click back on as many times as you want after those initial steps, The first list you selected at the start will be out of order the other two will be correct.

Any ideas on what could be causing this?

EDIT–
Things I have found so far:
ColumnDisplayIndexChanged fires many many times (over 200 times) when I view the first selection a second time. if the function does nothing it still loads the page, if i put a dialog box to show it fired (it was a lot of clicks) eventually i either get a big red X in the data grid view area or it loads fine (depending on the page, I get a X for pre-production but the other two loads fine (the message box still shows up hundreds of times) when you select them first)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:15:45+00:00Added an answer on May 14, 2026 at 6:15 am

    I took the easy way out. I just created 3 DataGridView and set them visible based off of the radio button.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have data that has this kind of structure. Will be in ascending order by
I have this kind of Html list: lista = <ul> <li>Arts &amp; Entertainment <ul>
Have data that has this kind of structure: $input = [ { animal: 'cat',
I have this kind of simple query that returns a not null integer field
This kind of problem is difficult to search and best explained by images. Here
Can i have this kind of set up? I want to create a normal
this kind of emergency, so please, can someone help me... I'm using movingboxes plugin
I have this kind of question. In my form, i got this as a
I know this kind of questions have been asked already many times before. The
this is my first time facing this kind of problem. I connected to internet

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.