通过TreeList.NodeCellStyle事件,可以对单元格外观进行自定义
关键代码:
private void treeList1_NodeCellStyle(object sender, DevExpress.XtraTreeList.GetCustomNodeCellStyleEventArgs e)
{
if (e.Column.FieldName != "BUDGET") return;
if (Convert.ToInt32(e.Node.GetValue(e.Column.AbsoluteIndex)) > 500000)
{
e.Appearance.BackColor = Color.FromArgb(80, 255, 0, 255);
e.Appearance.ForeColor = Color.White;
e.Appearance.Font = new Font(e.Appearance.Font, FontStyle.Bold);
}
}
欢迎任何形式的转载,但请务必注明出处,尊重他人劳动成果
转载请注明:文章转载自:DevExpress控件中文网 [https://www.devexpresscn.com/]
本文地址:https://www.devexpresscn.com/post/139.html