PDA

Click to See Complete Forum and Search --> : Datagrid Question, windows Forms


Venkrishna
Sep 17th, 2004, 05:24 AM
Guys,

Sorry if I am asking this question again. Not much used to .Net windows forms.

I have been struggling with this for sometime. Hope there are few angels in this forums to help me.

I have a datagrid being populated by a dataset. At run time
the grid does not show the data unless the + expander is clicked.
After clicking this + a hyper link 'Table' is displayed which i have to again click for the datagrid to be populated with the data.

Is there any method to override this so that as the form loads the datagrid is complete with the data.

please provide any code / examples.

Thanks in advance.

DevGrp
Sep 19th, 2004, 08:10 AM
The reason why that is happening is because you are passing the dataset object to the DataGrid to be binded. Pass the table directly like this

dataGrid1.DataBind = MyDataSet.MyTables[0];

Venkrishna
Sep 24th, 2004, 10:52 AM
DevGrp,

As I said there is an angel. So you are!!!!!

Thank you very much. That clears off much burden from my head.