DataGrid Sorting with the Compact Framework
Automatic sorting on columns in a DataGrid is not built in to the Compact Framework, but it can be accomplished with relatively little code. Cjcraft tells you how on his blog.
The code can be modified if you're using the new BindingSource control coupled with a DataSet (the dataView lines are not needed). For example:
bs = (BindingSource)dataGrid.DataSource;
ds = (DataSet)bs.DataSource;
dataTable = ds.Tables[0];
.
.
.
if (bs.Sort == columnName)
bs.Sort = columnName + " DESC";
else
bs.Sort = columnName;
-Krip
Categories: Windows Mobile_, .NET_
