【发布时间】:2012-12-15 17:27:37
【问题描述】:
我有一个简单的RadGridView,我想在其中更改特定行(= 3 个单元格)的文本颜色。不幸的是,这段代码不起作用:
//add new row to the grid
EventLogGrid.Items.Add(new EventLogRow(eventType, occured, msg));
//change the color of the text of all cells if it's an exception
if (eventType == EventLogger.EventType.Exception)
{
var rows = this.EventLogGrid.ChildrenOfType<GridViewRow>();
rows.Last().Foreground = new SolidColorBrush(Colors.Yellow);
}
我们将不胜感激。
【问题讨论】:
-
“不起作用”是什么意思?错误是什么?更具体。
-
您查看过 Telerik 网站上的文档吗?他们有大量的工作示例
-
@Soner Gönül:没有错误,它根本不会改变文本的颜色。
-
Mike 为什么不用这个事件开始编写代码来改变颜色.. protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e){ }
-
@DJ KRAZE:好的,谢谢,马上试试。
标签: c# wpf telerik telerik-grid radgridview