Example without DataAdapter for InitializeSelfReferenceDataSource needed

2 replies. Last post: September 9, 2009 10:34 PM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Eric Member

When loading data on demand in a grid that has several nodes and the user clicks on one of these minus boxes, then the node should open and the next level of data be displayed.

For that is the InitializeSelfReferenceDataSource event. The parameter e.DataSource is read-only. Therefore the sample (in the documentation of this event) simply casts the e.DataSource into a DataTable. Then a DataAdapter fills in the data.

How would this work when I only have an existing DataSet? I also tried to cast the e.DataSource to a DataTable and assigned the existing DataSet.Table(0) to that DataTable. But the grid doesn't get the data somehow.

I also tried to copy the rows in a foreach loop, but I get a runtime error saying the rows belong to different tables.

If I don't have a DataAdapter, only a DataSet, how would this event fetch the data for the grid?

All times are GMT -5. The time now is 3:28 PM.
Previous Next