DataGrid View Question

Hello all,

When I map a DataSet to a DataGrid using the following code:

SqlDataAdapter1.Fill(DataSet11, "Categories")
DataGrid1.DataSource = DataSet11

(This is from a book I'm using to learn Visual Studio .Net)

the grid populates and everything works fine, however I have one issue that I need help with:

When I run the app (a windows forms application), I have to click on a "+" sign to expand the grid, then I have to click on a link that says "Categories" before my data will display in the format that I want.

If I add the line "DataGrid1.Expand(-1)" , I no longer have to click on the "+" sign, but I still have to click on the "Categories" link.

Additional uses of "DataGrid1.Expand(-1)" make no difference.

Is there a setting or method that will perform this "Drilling Down" action for me?

Thanks in advance.

Charlie
[934 byte] By [crpowell] at [2007-11-18 2:14:44]
# 1 Re: DataGrid View Question
When you have several related tables you can see + sign. If you want to start with a table without clicking a sign, then after line

DataGrid1.DataSource = ds

add line

DataGrid1.DataMember = "TableName"
Iouri at 2007-11-10 3:25:11 >
# 2 Re: DataGrid View Question
Thanks! Works like a champ!

It's always the simple things...
crpowell at 2007-11-10 3:26:16 >