Hi -
I have a grid that contains multiple field layouts that are represented by nested ObservableCollections.
A Total of children
50
75
10
B Total of children
-7
-2
-9
When I sort by the column, I want the rows in the nested collection to sort but I the top level collection (totals) to remain fixed. In addition, when I sort descending, the largest negative number should come first. When I sort that column descending, it should look like this:
A
B
How would I go about this?
Thanks!
Hello,
I have been looking into the description of the functionality that you want and I am not sure I completely understand the first part of your question. Would you please give me more detailed description of the functionality that you are trying to achieve?
About the second part of your question, this can be achieved by setting custom SortComparer for the field that you want to be sorted that way. I have created a sample application that demonstrates how you can set the SortComparer property of the FieldSettings for a given field. In order to achieve this sorting I created a class which implements IComparer interface and compare the values by their absolute values using the Math.Abs method.
If you have any further questions please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
The example just returns the cell value in the comparer. Is there any way to get row data and compare based on datat in different columns ?
Hello Sanket,
Thank you for your post.
It has been a while since you have made your post, in case you still need support I will be glad to assist you further. I suppose the other community members can benefit from this answer as well. I have been looking into the functionality that you are trying to achieve and what I can suggest is to take a look at the following forum thread, where similar functionality was discussed:
http://ko.infragistics.com/community/forums/t/49234.aspx
Please do not hesitate to let me know if you have any further questions on this matter.