FlexGrid for WinForms | ComponentOne
Sort / Sort Indicator
In This Topic
    Sort Indicator
    In This Topic

    FlexGrid displays sort indicator, a small triangular arrow sign, to indicate the direction of sorting. The grid also provides flexibility to hide, display, position or customize the indicator.

    Hide or Display Sort Indicator

    FlexGrid, by default, displays the sort indicator when a column header is clicked to sort the columns. However, you can hide the indicator by setting the ShowSortPosition property to None. The property accepts values from ShowSortPositionEnum enumeration.

    Use the code below to hide the sort indicator displayed on the sorted WinForms FlexGrid column.

    // Hide the sort indicator 
    c1FlexGrid1.ShowSortPosition = ShowSortPositionEnum.None; 
    
    ' Hide the sort indicator 
    c1FlexGrid1.ShowSortPosition = ShowSortPositionEnum.None       
    

    Position Sort Indicator

    Sort indicator, by default, gets displayed towards the right side of the header cell. However, when the filtering is applied on a column, the sort indicator displays on top of the header cell to give place to the filtering icon. You can fix the position of sort indicator by setting value of ShowSortPosition property to Top or Right.

    Customize the position of column sort indicator in WinForms FlexGrid using the code below.

    // Change the position of sort indicator to top
    c1FlexGrid1.ShowSortPosition = ShowSortPositionEnum.Top; 
    
    ' Change the position of sort indicator to top
    c1FlexGrid1.ShowSortPosition = ShowSortPositionEnum.Top       
    

    Customize Sort Indicator

    FlexGrid provides the GlyphEnum enumeration which lets you specify the image to be used for sort indicator. For more information on the GlyphEnum and glyph customization, see Custom Glyphs.