Compare old and new value in DataGridView cell

前端 未结 4 751
暗喜
暗喜 2021-01-11 11:18

How to change DataGridView cell ForeColor based on whether new cell value is > or < than current/old cell value? Is there an event which passes the new value before the

4条回答
  •  鱼传尺愫
    2021-01-11 11:57

    You may want to look at the DataGridView.CellValueChangedevent (http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellvaluechanged.aspx).

    If you want to check the value before it is saved, then look at DataGridView.CurrentCellDirtyStateChanged (http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.currentcelldirtystatechanged.aspx).

提交回复
热议问题