Click here to Skip to main content
16,004,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute18-May-09 9:54
Henry Minute18-May-09 9:54 
GeneralRe: Multiple forms and datagridviews Pin
bwood202018-May-09 12:54
bwood202018-May-09 12:54 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute18-May-09 13:01
Henry Minute18-May-09 13:01 
GeneralRe: Multiple forms and datagridviews Pin
bwood202019-May-09 7:13
bwood202019-May-09 7:13 
GeneralRe: Multiple forms and datagridviews [modified] Pin
Henry Minute19-May-09 8:33
Henry Minute19-May-09 8:33 
GeneralRe: Multiple forms and datagridviews Pin
bwood202019-May-09 9:22
bwood202019-May-09 9:22 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute19-May-09 10:52
Henry Minute19-May-09 10:52 
GeneralRe: Multiple forms and datagridviews Pin
bwood202019-May-09 12:36
bwood202019-May-09 12:36 
Yes, there will only be one instance of Form 2. I have dragged and dropped a TabControl onto Form 2. Each tab contains a dgv which will be populated with a column from the dgv on Form 1.

I have created a method in Form 1 that goes through each cell in row 1 and stores the new headers in an array. if it meets the criteria then it should load the Distinct values of that column into Form 2. Here is the code I have written but don't know if you can use it as it is. But maybe you can...


<pre>public void button12_Click(object sender, EventArgs e)
            {
                 
                 
                        //MappingsForm is the name of Form 2
                        MappingsForm.Show();
              

                  string[] HeaderArray = new string[dataGridView1.ColumnCount];
                 

                        int n = dataGridView1.ColumnCount;
                        int c = 0;

                        for (c = 0; c < n; c++)
                        {
                              HeaderArray[c] = dataGridView1.Rows[0].Cells[c].Value.ToString();
                             
                              if(HeaderArray[c] == "DocType")
                              {
                                   
                                 //pass data to dgv1 on Form2  


                              }
                             
                              if(HeaderArray[c] == "PurposeType")
                              {
                                   
                                 //pass data to dgv2 on Form2  


                              }
                        }
            }</pre>

This is the last piece to the app. What are your concerns with the way the forms are passing the information? I would really like to hear about them.
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute19-May-09 13:48
Henry Minute19-May-09 13:48 
GeneralRe: Multiple forms and datagridviews Pin
bwood202020-May-09 10:02
bwood202020-May-09 10:02 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute20-May-09 10:14
Henry Minute20-May-09 10:14 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute20-May-09 10:19
Henry Minute20-May-09 10:19 
GeneralRe: Multiple forms and datagridviews Pin
bwood202021-May-09 6:25
bwood202021-May-09 6:25 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute21-May-09 7:01
Henry Minute21-May-09 7:01 
GeneralRe: Multiple forms and datagridviews Pin
bwood202021-May-09 8:48
bwood202021-May-09 8:48 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute21-May-09 9:08
Henry Minute21-May-09 9:08 
GeneralRe: Multiple forms and datagridviews Pin
bwood202021-May-09 9:54
bwood202021-May-09 9:54 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute21-May-09 10:42
Henry Minute21-May-09 10:42 
GeneralRe: Multiple forms and datagridviews Pin
bwood202021-May-09 13:01
bwood202021-May-09 13:01 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute22-May-09 9:59
Henry Minute22-May-09 9:59 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute22-May-09 10:05
Henry Minute22-May-09 10:05 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute22-May-09 10:08
Henry Minute22-May-09 10:08 
GeneralRe: Multiple forms and datagridviews Pin
Henry Minute22-May-09 10:12
Henry Minute22-May-09 10:12 
GeneralRe: Multiple forms and datagridviews Pin
bwood202022-May-09 10:19
bwood202022-May-09 10:19 
GeneralRe: Multiple forms and datagridviews Pin
bwood202026-May-09 4:08
bwood202026-May-09 4:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.