Click here to Skip to main content
14,700,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I get Operation did not succeed because the program cannot commit or quit a cell value change error on the Cell which accept only integer number. I apply CellValidating evnt having "e.Cancel"

private void dataGridView1_CellClick(object sender, DataGridViewCellMouseEventArgs e)
{
datagridview1.ClearSelection();
datagridview1.CurrentCell = null;
}


private void dataGridView1_CellValidating(object sender, DataGridViewCellValidatingEventArgs e)
{
e.Cancel = false;
}

Get Error at datagridview1.CurrentCell = null this statement in dataGridView1_CellClick Event.

Please Share if have solution.
Posted
Updated 6-Sep-14 21:33pm
v2
Comments
[no name] 7-Sep-14 3:21am
   
Why are you trying to set the current cell to null?
Kornfeld Eliyahu Peter 7-Sep-14 4:29am
   
You try to set to null a cell that can accept only integer number? And int gives error?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900