|
-
Sep 27th, 2005, 03:44 AM
#5
Re: A simple Data set / grid question
Yes. When you bind a DataTable to a control, the data in the control actually corresponds to the data in the DefaultView of the DataTable. When you sort the DataGrid by clicking a column header, you are actually setting the Sort property of the bound table's DefaultView. All this means that you can still get the corresponding row by indexing the DefaultView property of the DataTable rather than the Rows property. Note that the object returned will thus be a DataRowView rather than a DataRow. You can still index it to get a field value, but it doesn't behave exactly the same way in all circumstances. It has a Row property that returns the actual DataRow from the original DataTable.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|