I need to implement a custom sort on the fastObjectListView. I DO see the help at this page:
No CustomSorter on FastObjectListView
One incompatibility between v1.x and v2.0 is that FastObjectListViews can no longer have a CustomSorter. In v1.x it was possible, if tricky, to get a CustomSorter to work with a FastObjectListView, but that is no longer possible in v2.0 In v2.0, if you want to custom sort a FastObjectListView, you will have to subclass FastObjectListDataSource and override the SortObjects() method, then install that customized data source into your FastObjectListView:
class MyCustomSortingDataSource : FastVirtualListDataSource
{
override public void SortObjects(OLVColumn column, SortOrder order) {
// do some amazing sorting here
this.RebuildIndexMap(); // you must call this otherwise the control will not work properly
};
};
...
this.myFastObjectListView.DataSource = new MyCustomSortingDataSource(this.myFastObjectListView);
I just don't understand it. Visual Studio does not recognize "FastVirtualListDataSource".
In addition the comment '// do some amazing sorting here'. What is an example of "Amazing sorting'? I read that sorting the underlying data does not sort the listView. What would an example sort look like?
The column is mostly integers or the text value "Storage". I want the integers to sort like integers (they are stored as text) and "Storage" to come after all the integers.
Last edit: Eric Snyder 2024-01-04
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need to implement a custom sort on the fastObjectListView. I DO see the help at this page:
I just don't understand it. Visual Studio does not recognize "FastVirtualListDataSource".
In addition the comment '// do some amazing sorting here'. What is an example of "Amazing sorting'? I read that sorting the underlying data does not sort the listView. What would an example sort look like?
The column is mostly integers or the text value "Storage". I want the integers to sort like integers (they are stored as text) and "Storage" to come after all the integers.
Last edit: Eric Snyder 2024-01-04