Hey, I'm using the FastObjectListview and now I need to sort on 2 columns. So I tried using the example I found on the ObjectListview website but I can't get it to work.
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);
first of all I added:
using BrightIdeasSoftware;
but that namespace doesn't contain the FastVirtualListDataSource it contains a FastObjectListDataSource.
in the FastObjectListDataSource however there is no SortObjects method to override, there's a Sort method which I guess I should be overriding instead.
So this is what I got instead of the sample code:
class MyCustomSortingDataSource : FastObjectListDataSource
{
public MyCustomSortingDataSource(FastObjectListView listView)
: base(listView)
{
}
public override void Sort(OLVColumn column, SortOrder sortOrder)
{
base.Sort(column, sortOrder);
// do some amazing sorting here
// base.ObjectList.Sort(new ModelObjectComparer(this.olvGroupCln, SortOrder.Ascending, column, sortOrder));
this.RebuildIndexMap(); // you must call this otherwise the control will not work properly
}
}
I can't access the olvGroupCln which is the first column I need to sort on, after sorting that column I need to sort the column the user clicked on.
Some help would be gladly appreciated.
Thanks in advance.