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?
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?