
Sorted output from datagrid
Try getting the dataview from the CurrencyManager.List, and iterate through
the Row property there.
Dim cm As CurrencyManager = Me.BindingContext(Me.DataGrid1.DataSource,
Me.DataGrid1.DataMember)
Dim dv As DataView = CType(cm.List, DataView)
Dim i As Integer
For i = 0 To dv.Count - 1
Console.WriteLine(dv(i).Row(0).ToString() + " " +
dv(i).Row(1).ToString())
Next
======================
Clay Burch, .NET MVP
Visit www.syncfusion.com for the coolest tools
Quote:
> Say I fill a dataset and bind its table to a datagrid. After sorting the
> data using the datagrid's column headers, I'd like to iterate each row of
> the datagrid in the sorted order. Iterating the rows of the underlying
> table gives me the rows in the original order, so that's no good. Any
tips?