WinUI コントロール
並べ替えインジケータ
コントロール > FlexGrid > 並べ替え > 並べ替えインジケータ

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#
コードのコピー
// 列ヘッダーの並べ替えインジケータを非表示または表示します
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#
コードのコピー
// 並べ替えインジケータをカスタマイズします
flexGrid1.SortIconPosition = GridSortIconPosition.Inline;
flexGrid1.SortAscendingIconTemplate = C1IconTemplate.TriangleLeftUp;
flexGrid1.SortDescendingIconTemplate = C1IconTemplate.TriangleLeftDown;