WinUI コントロール
グリッド
コントロール > FlexGrid > スタイル設定と外観 > グリッド

FlexGrid lets you customize the overall look of the grid, not to just increase its aesthetic value but also increases its readability. You can add the alternate rows which make the grid more readable.

Set Alternate Row

To set the alternate row color and styles in the grid, you can use the AlternatingRowBackground and AlternatingRowForeground properties.

Use the code below to set styling at grid-level:

C#
コードのコピー
// 代替行を設定します
flexGrid1.AlternatingRowBackground = new SolidColorBrush(Colors.Aqua);
flexGrid1.AlternatingRowForeground = new SolidColorBrush(Colors.LightSalmon);