CheckBox in a dataGrid Event

R

Randy

Hello,
I've got a dataGrid which I have a bool column for a CheckBox. I'm setting
up a tableStyle for this. The checkboxes work fine. I'm trying to set up a
click (I think CheckChanged) event for the checkboxes so that if the user
checks/unchecks one it sets the underlying table value to true/false. I
think this should be set up in the tableStyle function but I'm not sure and
I'm unsure of the sytax of how to do it. Can someone give me a little sample
code of how to do this?
Thanks for any help...
Cheers :)
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Randy,

I believe your only chance to intercept this event is to inherit from the
DataGrid control and
to override its OnMouseDown and (optionally) OnMouseUp methods. Then, use
the
HitTest method to determine whether the click occured in the column in
question and react
appropriately.

You might also possibly do without inheritance, just try to handle the
MouseDown and MouseUp
events first.
 
R

Randy

Thanks for your help

Dmitriy Lapshin said:
Hello Randy,

I believe your only chance to intercept this event is to inherit from the
DataGrid control and
to override its OnMouseDown and (optionally) OnMouseUp methods. Then, use
the
HitTest method to determine whether the click occured in the column in
question and react
appropriately.

You might also possibly do without inheritance, just try to handle the
MouseDown and MouseUp
events first.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top