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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top