Sorting
I use the dapfor request to display data (My objects implement the INotifyPropertyChanged interface). When I enable sorting the sorting is applied dynamically (so if a value changes the grid is sorted again). Is it possible to disable the automatic resorting? I just one to sort the grid once and have the rows stay in that order until I want to sort the grid again.
Thanks,
Michel
-
Hello,
You can easily do it by implementing the ICustomSort interface:
class CustomSort : ICustomSort
{
public int Compare(Row row1, Row row2, string fieldId, object value1, object value2, int defaultResult)
{
//disable sorting
return 0;
}
}
//The following line disables sorting:
grid.CustomSort = new CustomSort();
//The following one enables it:
grid.CustomSort = null;For performance reasons it will be better to enable sorting. Look for more details here: http://www.dapfor.com/en/net-suite/net-grid/features/real-time-data-sorting.
Did you see docked rows feature. It can be useful if you want to keep rows in specified place:
http://www.dapfor.com/en/net-suite/net-grid/features/row-dockingBest regards,
Dapfor0
Please sign in to leave a comment.
Comments
1 comment