我有一个简单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);
}
任何输入将不胜感激。