【发布时间】:2012-12-10 20:09:54
【问题描述】:
在运行时在 RowFormatting 事件中设置 Telerik WinForms RadGridView 中行的背景颜色是否有一些技巧?我可以在此事件中设置 RowElement.Font,但不能设置 RowElement.BackColor。我已经在调试器中单步执行了代码,并确定该行正在执行(事件已正确“连接”)。
void grid_RowFormatting(object sender, Telerik.WinControls.UI.RowFormattingEventArgs e)
{
if (e.RowElement.RowInfo.Cells["CODE"].Value.ToString() == "X"))
{
// the following line is executed but has no apparent effect
e.RowElement.BackColor = System.Drawing.Color.Aqua;
}
}
【问题讨论】:
标签: telerik radgridview backcolor