A tool has been customized to perform other actions based on the values in DataGridView. When you modify a value in DataGridView and do other things directly,
The value in the result DataGridView is displayed as a, and the property of the operation is the unmodified value B.
According to the description of this article
http://blog.163.com/[email protected]/blog/static/22418624201098104916353/
According to the above description, the following modifications can be
winform DataGridView to submit the input in real time:
submits the table contents in the Currentcelldirtystatechanged event.
The code in the event is as follows:
if (this.dataGridView1.IsCurrentCellDirty)
{
this.datagridview1.commitedit ( Datagridviewdataerrorcontexts.commit);
}
Enter in DataGridView to trigger the Cellvaluechanged event in real time instead of triggering when the carriage return and focus leave