Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 21 行的网格视图。我的要求是设置一些行的背景颜色是浅绿色(如 1、5、13 行)这是否可以实现。
遍历每个 gridview 行并分配行的背景颜色:
foreach (GridViewRow row in yourGridView.Rows) { row.BackColor = Color.Green; }
是的,这是可能的。
viewerDataGrid.Rows[0].DefaultCellStyle.BackColor = myColor;