I need to sort my grid based on method that takes the contents of two columns of row.
like f( col1, col2) .
I can't just use the raw value of the columns -- how do I do this?
additional info
I am doing something like this now:
fieldLayout.SortedFields.Add(
new FieldSortDescription(ColumnName1, e.SortDescription.Direction, false
));
new FieldSortDescription(ColumnName2, e.SortDescription.Direction, false
and I need something like fieldLayout.SortedFields.Add( fx(Column1, Column2));
thanks
Hello Howard,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I added an UnboundField bound to the whole DataItem, which is Hidden and when you click a Button a custom sort is executed over the XamDataGrid.
Hope this helps you.
Great info -- getting me further. I have a follow up question
First I am doing everyting programatically/in code. XAML just for the layouts.
I see now that I need to sort by two columns one with a custom sort.
something like this
new FieldSortDescription("ColumnName1", e.SortDescription.Direction, false
new FieldSortDescription("NCustomSort", e.SortDescription.Direction, false
Also I have a custom class called NCustomSort and it is of IComparer
How do link this sort routine to the FieldSortDescription?
Thanks
I have modified the sample I sent you before, so now all the logic is moved in the code behind.