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
Vish DavPosted Jun 9, 2011, 1:56 AM
Dorababu MekaPosted Jun 9, 2011, 1:52 AM
Vish DavPosted Jun 9, 2011, 1:24 AM
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 :( :(
Posted Jun 9, 2011, 1:13 AM
Bind_DataGridView.DataSource = dSet.Tables[0].DefaultView;
MainTableGrid.DataSource = dSet.Tables[0].DefaultView;
Vish DavPosted Jun 9, 2011, 1:06 AM
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...
Dorababu MekaPosted Jun 9, 2011, 12:37 AM
Vish DavPosted Jun 8, 2011, 9:52 PM
The grid adds 3 rows as needed,however no information read from the data table is shown on the grid...
Posted Jun 8, 2011, 11:42 AM
For the gridviews, make autogeneratedcolumns = true;
Bind_DataGridView.AutoGeneratedColumns = true;
MainTableGrid.AutoGeneratedColumns = true;
Dorababu MekaPosted Jun 8, 2011, 11:11 AM