Martina Mullin

Martina Mullin

  • NA
  • 1
  • 2.4k

DataGridView Instancing

Feb 17 2011 11:35 AM

Hi,
I have a datagrid view that I pass by reference from one form, to a class to populate.
Once it's populated, I loop through the grid in the class and concatenate strings and hide columns as appropriate. 
Once prompted by the user, I loop through that DataGrid View to construct a SQL statement and I'm finished with the Data Grid View in Form 1.  I pass the SQL statement to a second form, form 2.  In form 2, I have another data grid view that is passed to the same class as the data grid view in form 1 and goes through the exact same process.
My problem is my application is getting confused as to which data grid view it's looking for because both form1 and form2 could be open with the data grid views populated.  I'm new to .net, am I using the Data Grid Views all wrong and why can't the system tell the difference between my two grids?
Thanks

LL

Answers (1)