Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid Data Results Returned

Status
Not open for further replies.

sylvanst

Programmer
Jan 15, 2003
8
US
I have a datagrid that returns a tree like view when data is returned. It appears with a (+) and DataResults link. When you click the link it displays all the data just fine.

How do I get rid of this first view so that the data in rows is displayed immediately? I've been looking for a datagrid property but I don't see one off hand.

Any ideas would be appreciated.

Thanks,
 
Are you assigning a DataSet as the datagrid's DataSource?

DataGrid1.DataSource = DataSet1

If so, assign a table from the DataSource:

DataGrid1.DataSource = DataSet1.Tables(0)

or

DataGrid1.DataSource = DataSet1.Tables("TableName")



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
jebenson. Thanks for the reply. Yes, in fact I do assign to the dataset as follows:

Dim da As OleDbDataAdapter = New OleDbDataAdapter(sSQL, myConnection)

' create a new dataset
Dim ds As DataSet = New DataSet
' fill dataset
da.Fill(ds, "DataResults")

DataGrid1.DataSource = ds.DefaultViewManager

Are you saying I have to go directly to a table in order to get the desired affect?
 
Yes, or use the Table's DefaultView:

DataGrid1.DataSource = ds.Tables("DataResults").DefaultView

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top