This information should be included in the remarks section.
Details:
The simple version is that you must make sure that no code paths
attempt to access DataGridView1._.Value as this will invalidate the
user entered text.
The issue was documented and solved here
http://social.msdn.microsoft.com/Forums/en-US/winformsdatacontrols/thread/702f3ad7-9109-4755-8377-35aeff0381a4/
An Excerpt:
I can reproduce your problem, I am not sure this one is the same as yours.
Look at this code, it works great.
void dataGridView1_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
{
dt.Rows[e.RowIndex][0] = e.Value;
}
Then I changed a little,
void dataGridView1_CellValuePushed(object sender, DataGridViewCellValueEventArgs e)
{
string s = dataGridView1[e.ColumnIndex, e.RowIndex].Value.ToString();
dt.Rows[e.RowIndex][0] = e.Value;
}
I have only added a line of code to read the value of the current cell.
In this situation, e.Value show the previous value. Through there is no
documentation show why, but base on my analyse, when you call the
"dataGridView1[e.ColumnIndex, e.RowIndex].Value", it fire the
CellValueNeeded and reload the data from the source. So the e.Value has
been rollback to the previous.
dt is the DataTable that I have used to load data and write data to.
If you have any doubt, please feel free to tell me.
Sincerely,
Kira Qian