This is a migrated thread and some comments may be shown as answers.

GridViewCheckBoxColumn - Need Check Changed Event

2 Answers 939 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick Barranis
Top achievements
Rank 1
Patrick Barranis asked on 13 Jul 2012, 09:41 PM
Hi.  I'm using a GridViewCheckBoxColumn, and I would like to have an event fire when the user changes the state of the checkbox by checking it, either by mouse or keyboard.  Right now I've found that I can hook a variety of events that only fire after the cell's value is changed and the cell loses focus.  But I need an event that actually happens as soon as the checkbox is changed.  I'm running version 2012.1.321.20.

The only thing I've found that works is reaching into the virtualized cell, getting the RadCheckBoxEditorElement, and then hooking the PropertyChanged event on it.  This is pretty ugly and cumbersome.  It also presents a serious issue in that I don't know how to hook this event just once, since if I hook this event in the CellFormatting handler, I will end up hooking the event many, many times.

Is there a straightforward way to accomplish what I want?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dave
Top achievements
Rank 1
answered on 14 Jul 2012, 03:22 PM
Hey Patrick,

I had a similar requirement where I wanted the CheckBox check event to fire immediately the click happens. I asked the same question and was told (if I read it correctly) that there isn't such a beast - refer to this post.

I provided a workaround in that post which essentially requires you to use an image column instead of a checkbox column and manually display the image of a checked or unchecked checkbox. The state of the checkbox toggles on the cell click which happens immediately - which is what I was looking for.

Hope this helps,

Regards,
Dave
0
Patrick Barranis
Top achievements
Rank 1
answered on 14 Jul 2012, 07:05 PM
Hi Dave.  Thanks!  Actually, I much prefer the solution from Svett on the same thread.  However you got me to a workable solution, which is what counts, so I'll go ahead and mark that as the answer.  Thanks again.
Tags
GridView
Asked by
Patrick Barranis
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Patrick Barranis
Top achievements
Rank 1
Share this question
or