<DataGrid AlternationCount="2">
           <DataGrid.RowStyle>
                <Style TargetType="{x:Type DataGridRow}">
                    <Style.Triggers>
                        <Trigger Property="ItemsControl.AlternationIndex" 
                                 Value="0">
                            <Setter Property="Background" Value="#FFE4DDB3" />
                        </Trigger>
                        <Trigger Property="ItemsControl.AlternationIndex" 
                                 Value="1">
                            <Setter Property="Background" Value="#FFF2F2F2" />
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.RowStyle>
        </DataGrid>

WPF datagrid 如何隔行变色

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2021-08-26
猜你喜欢
  • 2021-08-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案