Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have datagrid with checkbox column:

<datagridcheckboxcolumn.cellstyle>

&lt;EventSetter Event="CheckBox.Checked" Handler="Event_OnChecked"/>



I need in handler ("Event_OnChecked") return CheckBox in Unchecked state

pls. help (spent 3 hours with no result)
thanks

What I have tried:

I tried e.Handled = True
No result
Posted
Updated 7-Aug-18 17:21pm

1 solution

Not sure if you found your answer....

Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick

DataGridView1.EndEdit()
DataGridView1.Rows(e.RowIndex).Cells(column of checkbox).Value = False

End Sub

you can do it this way, or if you can get the row in your even handler, do it there.
Basically you have to turn off the check box.
the .EndEdit() sets the check so it is completed, then set it to false to turn it off
 
Share this answer
 

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