欢迎加入站点基地设计开发交流群:30720409
详细内容
silverlight里设置DataGrid行背景色和列颜色的方法
发布日期:2011-06-15     点击:9517     字体:[ ]

silverlight里设置DataGrid行背景色和列颜色,暂时没找到列背景属性,但可以设置前景色

在LoadingRow事件里:

private void rightControl_LoadingRow(object sender, DataGridRowEventArgs e)
 {

//程序

//设置行背景色

SolidColorBrush r = new SolidColorBrush(Color.FromArgb(180,180,0,0));

e.Row.Background = r;

//设置列颜色

((TextBlock)this.rightControl.Columns[i].GetCellContent(e.Row)).Foreground = r;

用户评论
昵称:匿名 来自:61.153.70.*  
2011-7-6 11:37:11
有滚动条时,滚动条滚动几下,就出问题了。
昵称 
内容  *
验证码   
   
Copyright © 2010 zdbase.com All Rights Reserved. 苏ICP备15039389号-1 可人软件设计