Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Custom sorting for string column (on both row level and group level)

Custom sorting for string column (on both row level and group level)

New Discussion
Bharat Jangir
Bharat Jangir asked on Sep 3, 2015 2:19 PM

I have a grid in which one column have string values and it's default sorting behavior is based on "Text sorting" but I want to apply custom sorting (for COL 4 in attached sample) like

COL 4 (ascending)
LENGTH
SHORT
SHORT
FIXED
BREADTH
BREADTH

COL 4 (descending)
BREADTH
BREADTH
FIXED
SHORT
SHORT
LENGTH

Also if I group by same column then sorting will be same order (not default sorting).

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on Sep 3, 2015 2:19 PM

    Hello Bharat,

    Thank you for posting in our forum.

    UltraGrid’s column exposes SortComparer property. By setting this property to you custom class you may sort the column in your specific order. More about this property you may find by following the next link http://help.infragistics.com/Help/Doc/WinForms/2015.1/CLR4.0/html/Infragistics4.Win.UltraWinGrid.v15.1~Infragistics.Win.UltraWinGrid.UltraGridColumn~SortComparer.html.

    In the attached sample I have created a one column grid which implements SortComparer. Please check my sample and let me know if this is what you are looking for or if I am missing something.

    Please let me know if you have any additional questions.

    Thank you for using Infragistics Controls.

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Bharat Jangir
Favorites
0
Replies
1
Created On
Sep 03, 2015
Last Post
10 years, 5 months ago

Suggested Discussions

Tags

Created by

Created on

Sep 3, 2015 2:19 PM

Last activity on

Sep 3, 2015 2:19 PM