Hi,
I have a DataGridView that has 3 columns predefined,one of them is a Drop down.
Now I populate a Datatable and bind it to this DataGridView.
However,I do not see any Data Displayed on the DataGridView.On Debugging,I found that the DataTable reads 3 rows,these 3 rows are added to the DataGridView(which can be seen),but there is no Data Visible..Any Clues??
conn_obj.Connect();
SQL = "SELECT FIELDNAME BS_FIELDF WHERE FK_TABDF = '";
SQL = SQL + Table_pkey + "' ORDER BY FIELDNAME";
dSet = conn_obj.SQL_Data_Retrieve(SQL.ToString(), "BS_FIELDF");
conn_obj.DisConnect();
Bind_DataGridView.DataSource = dSet.Tables[0];
MainTableGrid.DataSource = Bind_DataGridView.DataSource;
MainTableGrid.Refresh();
MainTableGrid.Parent.Refresh();
I get to see the 3 rows,but I don't see any information displayed....Any Advice would be much appreciated..
Loading

Dorababu MekaRank #457 · 5.5K reputationPosted Jun 8, 2011, 7:11 AM EDT
Posted Jun 8, 2011, 7:42 AM EDT
For the gridviews, make autogeneratedcolumns = true;
Bind_DataGridView.AutoGeneratedColumns = true;
MainTableGrid.AutoGeneratedColumns = true;
Vish Dav16 reputationPosted Jun 8, 2011, 5:52 PM EDT
The grid adds 3 rows as needed,however no information read from the data table is shown on the grid...
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 8, 2011, 8:37 PM EDT
Vish Dav16 reputationPosted Jun 8, 2011, 9:06 PM EDT
THis is the change i've made but still am not able to see any information on the grid...
conn_obj.Connect();
SQL = "SELECT FIELDNAME BS_FIELDF WHERE FK_TABDF = '";
SQL = SQL + Table_pkey + "' ORDER BY FIELDNAME";
dSet = conn_obj.SQL_Data_Retrieve(SQL.ToString(), "BS_FIELDF");
conn_obj.DisConnect();
MainTableGrid.AutoGenerateColumns = true; // Added now....
Bind_DataGridView.DataSource = dSet.Tables[0];
MainTableGrid.DataSource = Bind_DataGridView.DataSource;
MainTableGrid.Refresh();
MainTableGrid.Parent.Refresh();
Still no result...Please Advice...Thanks in advance...
Posted Jun 8, 2011, 9:13 PM EDT
Bind_DataGridView.DataSource = dSet.Tables[0].DefaultView;
MainTableGrid.DataSource = dSet.Tables[0].DefaultView;
Vish Dav16 reputationPosted Jun 8, 2011, 9:24 PM EDT
I did the following but still no result..
conn_obj.Connect();
SQL = "SELECT FIELDNAME BS_FIELDF WHERE FK_TABDF = '";
SQL = SQL + Table_pkey + "' ORDER BY FIELDNAME";
dSet = conn_obj.SQL_Data_Retrieve(SQL.ToString(), "BS_FIELDF");
conn_obj.DisConnect();
MainTableGrid.AutoGenerateColumns = true; // Added now....
Bind_DataGridView.DataSource = dSet.Tables[0].DefaultView; //Changed Now..
MainTableGrid.DataSource = dSet.Tables[0].DefaultView; // Changed now
Still No Result :( :(
Dorababu MekaRank #457 · 5.5K reputationPosted Jun 8, 2011, 9:52 PM EDT
Vish Dav16 reputationPosted Jun 8, 2011, 9:56 PM EDT