Sort grid
Hello,
How to set sorting for one column in grid but not allow to user. I want to set one column to sort as default.
Example. grid.Column["Price"].Sort = Sort.Ascending. Every time I update the grid, this will be sort. When user click column header, there will be no change.
In other words I would like to sort every time i added the grid row but not allow user to sort by column click.
There will be no change after column click by user.
Thanks in advance.
0
-
Hello,
Try the following:foreach(Column column in grid.Headers[0])
{
//Prevent the user from sort changing
column.Sortable = false;
}
//Set sorting programmatically
grid.Headers[0].Column["Price"].SortDirection = SortDirection.Ascending;King regards,
Dapfor0
Please sign in to leave a comment.
Comments
1 comment