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.
如果前一行的特定单元格的值发生变化,我想更改一行的颜色。我有一个绑定数据集数据的 Datagrid。例如。
编号 质量 价格 美分 MM 尺寸
1 AQ 78000 0.001 0.70
2 AQ 78000 0.001 0.75
3 AQ 76000 0.011 0.76
4 AQ 76000 0.012 0.77
如果Price的值发生变化,我想更改下一行的颜色。我无法在 Datagrid 中获取 rowindex。我尝试使用ItemBound事件如何更改与其先前值相比的行颜色。?
ItemBound
您可以访问 RowDataBound 事件中的行。
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { // do stuff } }