Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1325
XamDataGrid custom sorting on "DataItems" level
posted

is there any way to set a sort comparer for "DataItems" level rather than "Field" level? My comparer is using advanced compare logic and should deal with data items, not with a field values.

  • 30945
    Offline posted

    Hello,

     

    I have created a sample application that demonstrates an approach for implementing the functionality that you are looking for. In order to implement this approach I created an invisible UnboundField that contains the DataItem for the current Record. I have created custom sort comparer for this field and also handle the Sorting event of the XamDataGrid. In the event handler  I set e.Cancel to true and add a FieldSortDefinition for the UnboundField. By doing so it is possible to perform comparison at DataItem level.

     

    If you need any further assistance please do not hesitate to ask.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support