1、设置treelist不同行的颜色
void treeList1_CustomDrawNodeCell(object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e) { if (e.Column == treeListColumn1) { if (e.CellValue.ToString() == "1") { e.Appearance.BackColor = Color.Red; e.Appearance.Options.UseBackColor = true; e.Appearance.ForeColor = Color.Yellow; e.Appearance.Options.UseForeColor = true; } } }
2、DataGridView 添加数据