如何判断devexpress gridcontrol的数据被修改过
1个回答
展开全部
您好,有个笨办法,你在GridControl中加入一列用来保存当前行的状态,如果修改了则改变此列的数据。颜色只要根据此列数据来刷新就OK。
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
if (e.Column.FieldName == "cgrbh")
{
string aa = gridView1.GetRowCellDisplayText(e.RowHandle, gridView1.Columns["cgrbh"]);
if (aa == "6666")
{
e.Appearance.BackColor = Color.DeepSkyBlue;
e.Appearance.BackColor2 = Color.LightCyan;
}
}
private void gridView1_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
{
if (e.Column.FieldName == "cgrbh")
{
string aa = gridView1.GetRowCellDisplayText(e.RowHandle, gridView1.Columns["cgrbh"]);
if (aa == "6666")
{
e.Appearance.BackColor = Color.DeepSkyBlue;
e.Appearance.BackColor2 = Color.LightCyan;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询