Display contents of Data Grid

  • Thread starter Thread starter Ken Allen
  • Start date Start date
K

Ken Allen

I have an application that invokes a remote process that returns a (possibly
empty) DataSet as the result, and the contents of this are then displayed in
a DataGrid by setting the data source to reference the DataSet. I cannot
figure out how to have the DataGrid automatically show the data itself.

By default the grid displays a triangle control and I must click on the "+"
to see the name of the DataTable in the DataSet and then click on that name
to see the data. I found a reference to an Expand(row), but this only causes
the name of the table to be automatically displayed. How can I have the
table itself 'open' as well?

-Ken
 
Hi Ken,

Try setting DataTable as datasource.
Or set DataMember property to a table name.
 
Thanks. That did the trick -- as long as the DataSet is not empty, of
course!

-Ken

Miha Markic said:
Hi Ken,

Try setting DataTable as datasource.
Or set DataMember property to a table name.

--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com

Ken Allen said:
I have an application that invokes a remote process that returns a (possibly
empty) DataSet as the result, and the contents of this are then
displayed
in
a DataGrid by setting the data source to reference the DataSet. I cannot
figure out how to have the DataGrid automatically show the data itself.

By default the grid displays a triangle control and I must click on the "+"
to see the name of the DataTable in the DataSet and then click on that name
to see the data. I found a reference to an Expand(row), but this only causes
the name of the table to be automatically displayed. How can I have the
table itself 'open' as well?

-Ken
 
Back
Top