【发布时间】:2017-04-19 17:46:35
【问题描述】:
我的 ASPxGridView 正在从数据库中加载大量数据。每次在网格上加载新数据时,我都会根据数据库中的资源将每种 Cellstyle 颜色显示为 BackColor。
我将尝试在下面阐明我想要实现的目标:
这是我尝试过的。它正在工作,但所有其余行仍然是 System.Drawing.Color.Red。我不想看到。
protected void ASPxGridViewTicketList_CustomUnboundColumnData(object sender, DevExpress.Web.ASPxGridViewColumnDataEventArgs e)
{
if (e.Column.Caption == "Status")
{
Object is_priority = e.GetListSourceFieldValue("ispriority");
if (is_priority.ToString() == "1")
{
e.Column.CellStyle.BackColor = System.Drawing.Color.Red;
}
else
{
e.Column.CellStyle.BackColor = System.Drawing.Color.AliceBlue;
}
}
}
您对此有解决方案吗?谢谢!
这是一个插图:
- 当存在 if == 1 then RED else White 的条件状态时,我想一次又一次地停止颜色的冷却。在此插图中,只有 1 行必须为红色,其他行必须为白色。但它不起作用。
【问题讨论】:
-
请粘贴实际网格的屏幕截图,并用不同的背景颜色标记要显示的新行。
-
好的,我会把它添加到我的问题中。
标签: c# datagridview devexpress aspxgridview