使用C1Theme.ApplyTheme(...);后, 不能改变行的颜色样式
有一个C1DataGrid 像下面这样,
<Grid Name="gdRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<c1:C1DataGrid x:Name="gridShare" Grid.Row="1" ItemsSource="{Binding}"LoadedCellPresenter="GridShare_OnLoadedCellPresenter" GridLinesVisibility="Horizontal">
<c1:C1DataGrid.Columns>
<c1:DataGridTextColumn Header="标题" Binding="{Binding ShareTitle}"/>
</c1:C1DataGrid.Columns>
</c1:C1DataGrid>
<Grid>
在类上初始化一个C1ThemeOffice2013White样式
private C1ThemeOffice2013White _office2013White = new C1ThemeOffice2013White();
在构造函数上,应用C1ThemeOffice2013White样式
C1Theme.ApplyTheme(this.gdRoot, _office2013White);
监听LoadedCellPresenter 事件,想在某种情况下,改变行的颜色为蓝色,但是运行过程中,行的颜色不会变蓝
private void GridShare_OnLoadedCellPresenter(object sender, DataGridCellEventArgs e)
{
if(true){
//e.Cell.Presenter.Foreground = new SolidColorBrush(Colors.Blue);
e.Cell.Presenter.SetValue(DataGridCellPresenter.ForegroundProperty, new SolidColorBrush(Colors.Blue));
}
}
请问我要 如何做才能让行变色 |
|