My sorted field has strings. A couple of strings start with '~' and all others with alphabets. The ASCII value of ~ is higher than alphabets but the strings starting with ~ show in the beginning. How do I make sure that they are always at the end when sorting order is ASC.
Thanks.
Hello Jay6447,
Just checking in, did you have any other questions or concerns on this matter?
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you for your post!
The XamDataGrid uses the standard .NET Framework sort comparisons when sorting fields, and after some investigation, it appears that this behavior you are seeing is expected. For example, if you called the following code: int I = string.Compare("~", "any alphabetic character (A-Z)"), you will notice that I will be -1, meaning that "~" comes before alphabetic characters in this case.
If you would like your "~" characters to show up after your alphabetic characters when applying an ascending sort to your XamDataGrid, I would recommend that you define a custom sort comparer for the field you wish to sort. Here is a link to a separate forum thread where custom sorting in the XamDataGrid is discussed: http://es.infragistics.com/community/forums/p/57047/292051.aspx.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.Infragistics.com/support