找回密码
 立即注册

QQ登录

只需一步,快速开始

何家旋

最新发帖
何家旋
注册会员   /  发表于:2016-6-15 10:09:42
12#
解决了,谢谢管理员提示。解决方法:
C1DataGrid[e.Cell.Row.Index, 0].Presenter.Background = new SolidColorBrush(Colors.Green);
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-6-15 12:01:31
13#
本帖最后由 Alice 于 2016-6-15 12:03 编辑
何家旋 发表于 2016-6-15 09:55
你好管理员! 我的需求是编辑单元格后,在失去焦点场合,校验的入力值不正确时,当前单元格设置成红色。
...
谢谢反馈。

对于C1DataGrid,有一些处理技巧。
如果是想特定的值处理成特定的颜色,可以使用DataTrigger,用xmal代码实现。
代码参考:

  1.   <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=Row.DataItem.Nummer}" Value="5">
  2.                             <Setter Property="Background" Value="Yellow"></Setter>
  3.                         </DataTrigger>
复制代码

可参考博客:
http://blog.gcpowertools.com.cn/ ... ltidatatrigger.aspx

如果是要对合法性做校验,并且提示,可以使用IDataErrorInfo。
具体设置可以参考产品博客:
http://blog.gcpowertools.com.cn/ ... PF_Validation1.aspx

如果是条件话设置样式,可以参考示例:  C1DataGrid-更多-条件格式化,示例下载地址:
http://www.gcpowertools.com.cn/p ... dio_wpf_democlk.htm

点评

5分  发表于 2016-6-15 12:52
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
何家旋
注册会员   /  发表于:2016-6-17 08:37:24
14#
Alice 发表于 2016-6-15 12:01
谢谢反馈。

对于C1DataGrid,有一些处理技巧。

http://gcdn.gcpowertools.com.cn/showtopic-22968-1-1.html  
回复 使用道具 举报
Alice
社区贡献组   /  发表于:2016-6-17 10:47:52
15#
何家旋 发表于 2016-6-17 08:37
http://gcdn.gcpowertools.com.cn/showtopic-22968-1-1.html

已经在另一个帖子回复,请参考:
http://gcdn.gcpowertools.com.cn/showtopic-22968-1-1.html
请点击评分,对我的服务做出评价!  5分为非常满意!

葡萄城控件服务团队

官方网站: http://www.gcpowertools.com.cn
回复 使用道具 举报
12
您需要登录后才可以回帖 登录 | 立即注册
返回顶部