编程语言
首页 > 编程语言> > C# datagridView 表格渲染变色

C# datagridView 表格渲染变色

作者:互联网

private void DGV_CellPainting(object sender, DataGridViewCellPaintingEventArgs e)
        {

            if (e.ColumnIndex >= 0 && DGV.Columns[e.ColumnIndex].Name == "字段名称")
            {
                if (Collections.Entity.to_double(e.Value) > 0)
                {
                    e.CellStyle.BackColor = Color.Red;
                }
                else
                { }
            }
          

        }

标签:CellStyle,表格,C#,private,datagridView,ColumnIndex,DGV,Collections,Columns
来源: https://www.cnblogs.com/LuoCore/p/16164204.html