找回密码
 立即注册

QQ登录

只需一步,快速开始

JK_Pro

高级会员

4

主题

5

帖子

1980

积分

高级会员

积分
1980

活字格认证

JK_Pro
高级会员   /  发表于:2014-4-3 15:35  /   查看:4829  /  回复:1
使用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));
         }
}

请问我要 如何做才能让行变色

1 个回复

倒序浏览
roger.wang
社区贡献组   /  发表于:2014-4-8 11:49:00
沙发
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部