Our xamDataGrid is bound to a collection. In our collection we have a field that we track internally and don't display to the user (it's not a field that has relevant meaning to the user). This field is RelativeMeasure and what it really tracks is absolute position from the start to the end of a line. In lieu of displaying RelativeMeasure, we display 4 other fields in our grid that have actual meaning to the user such as Route, Series, Station and Measure (these fields have domain meaning to the user for a location on the line). We display additional fields to the user such as % error that the user might want to sort on so we allow sorting in our grid so the user can sort by whatever column they want.
The trouble is, that the user, when they go to sort by Route, Series, Station or Measure what they are really expecting is a sort by RelativeMeasure. Is there a way when the user clicks on one of these headers that we can sort by RelativeMeasure instead of the column they selected?
Thanks!
Hello Darlene,
Thank you for your post. I have been looking into it and I can suggest you see these forum threads:
http://es.infragistics.com/community/forums/p/57047/292051.aspx
and
http://es.infragistics.com/community/forums/p/84023/419562.aspx
where similar questions as yours are already discussed. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Thanks for the link suggestions.
Following the suggestion in the first link I wrote a comparer and added it as the SortComparer to my fields that I wanted sorted differently. However, in my comparer, all I'm getting is the cell value instead of the cell itself so I have no way of getting the other value from my data object.
<igDP:UnboundField Label="Series" Width="64"> <igDP:UnboundField.Binding> <MultiBinding Converter="{StaticResource SeriesConverter}"> <Binding Path="Route" Mode="OneWay"/> <Binding Path="Measure" Mode="OneWay"/> <Binding Source="{StaticResource SeriesRecordsBindingProxy}"/> </MultiBinding> </igDP:UnboundField.Binding> <igDP:UnboundField.Settings> <igDP:FieldSettings CellValuePresenterStyle="{StaticResource RightAlign}"/> </igDP:UnboundField.Settings> </igDP:UnboundField>
The suggestion in the second link will not work for me because as you see with the xaml above, I already have a multi-value converter set on the unbound field.
Is there a way to pass the Cell or DataItem to the Comparer instead of the actual cell value?
Thanks,Darlene