data grid control problem

  • Thread starter Thread starter cfyam
  • Start date Start date
C

cfyam

After I set the datagrid allowsort is true, the position of data binding
will not correct when i click the row header!
How can I slove the problem?
 
Hello,

There are several possible problems matching your description. Could you
please be more specific on what do you want to achieve and what is going
wrong?
 
You will have to do something like this in the DataGrid_SortCommand Event.

DataView SortedView =(DataView)(DataGrid1.DataSource);
SortedView.Sort= e.SortExpression+" DESC";
DataGrid1.DataSource=SortedView;
DataGrid1.DataBind();

This will sort in the descending order.
 
Back
Top