加一列,颜色,然后输入颜色值,如 red blue yellow 等
drawcell代码
If e.Row.IsNull("颜色") = False Then e.Table.DataTable.AddUserStyle(e.Row("_identify"),Color.FromName(e.Row("颜色")), Color.Black) e.style = e.Row("_identify")End If