WinUI | ComponentOne
Controls / FlexGrid / 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, 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 ShowSort property to false.

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

    C#
    Copy Code
    // Hide or Display sort indicators in column headers
    flexGrid1.ShowSort = false;
    

    Customize Sort Indicator

    FlexGrid provides the SortIconPositionSortAscendingIconTemplate and SortDescendingIconTemplate properties to customize sort indicator. The SortIconPosition accepts values from GridSortIconPosition enumeration, while the SortAscendingIconTemplate and SortDescendingIconTemplate properties accept values from the C1IconTemplate class.

    C#
    Copy Code
    // Customize Sort Indicator
    flexGrid1.SortIconPosition = GridSortIconPosition.Inline;
    flexGrid1.SortAscendingIconTemplate = C1IconTemplate.TriangleLeftUp;
    flexGrid1.SortDescendingIconTemplate = C1IconTemplate.TriangleLeftDown;