我有一个datagrid
,其中我试图遍历特定列的行以检查单元格中的值,并根据我想要执行某些格式化的值。
我使用以下代码
循环使用DG for (int i = 0; i < dgdPriceDropdown.VisibleRowCount;i++ )
{
double temp=(Convert.ToDouble(dgdPriceDropdown[i,6]));
if (Math.Floor(Convert.ToDouble(dgdPriceDropdown[i,6]))==0.97)
{
}
}
现在,我想将背景颜色应用于小数
之后值为97的单元格我知道这样做的方法吗?
答案 0 :(得分:1)
对于迭代数据网格的行,此链接可能很有用 Iterating_Through_DataGrid,为了格式化DataGrid,此项目可能有用DataGrid_Formatting