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

Checkbox Failing to Stay Checked

1 Answer 67 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 31 Jul 2013, 01:29 PM
We've got a datagrid that is using a checkbox in the header of a column to act as switch to "Select All" or "Unselect All". There's a problem with it that it works ok for a while but then after swapping the page in and out the checkbox stops working. What we actually see is that it starts out empty, the user clicks on it and the "checked" event fires immediately followed by the "unchecked" event and so the user can never actually get the checkbox to stay checked. 

The checked and unchecked event handler looks fine and we don't have code that sets the checkbox in anyway, so it's quite puzzling why this could be happening. 

To make things more interesting, the behavior only happens when we're NOT debugging. So, if we enter the same code while in debug mode, the bug doesn't happen. 

So, a few questions....

1. What's the best way to see all of the event handlers that have been stacked up on the checked and unchecked events? 
2. Does the checkbox or the gridview that we're using have any code that might be different in debug vs. non-debug modes?
3. Are there scenarios when the checkbox would immediately revert itself? For instance, if there is an error in a handler for the checkbox "checked" event, would the checkbox immediately revert itself back to "unchecked" and also call the "unchecked" event handler?

1 Answer, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 05 Aug 2013, 11:21 AM
Hi,

Do you use the GridViewSelectColumn or have you defined your own custom column to handle the multiple selection? If it is the second option, then have you tried using the GridViewSelectColumn? If you have to use your custom column, then would you please share some code snippets on your logic?

You say that the problem occurs after swapping the page in and out., would you please share a little bit more details on how have you implemented the paging? Does the issue also appears if you comment all the code you execute when the "Checked" and "Unchecked" events are raised? 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
Buttons
Asked by
Brian
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Share this question
or