I am using the UltraWebGrid from Version 10.2.20102.2152. Two of my grid columns are checkbox columns. The grid allows the user to check/uncheck the checkbox column. I then have to check/uncheck related rows based on business rules. I implemented the logic in the AfterCellUpdateHandler event. The problem I am facing - everytime I set the value for the checkbox column programmatically it refires the event. How to do I prevent the event from re-firing or how do I detach the event before setting the column values and attach the event back later.
The grid also has a checkbox in the header column. On check/uncheck of the header column, I have to select/unselect all the rows of the grid. This I have implemented in another JavaScript function but setting the column values again calls the AfterCellUpdateHandler event.
Hello Ram,
I would suggest use a global variable for this task and keep track if the column is updated by your programming code or by the user e.g:
var isChekcedByUser = true; function AfterCellUpdateHandler(grid, cellid) { if (isChekcedByUser) { // run your custom logic here isChekcedByUser = true; } } //used to select all rows function selectAll() { // select all checkboxes isChekcedByUser =false }
Hope that helps.
Thank you for your response!
Can the same be done in the server event without recursion?
Thanks!
I think you can do that but you need to substitute the global variable with session object in order to keep track over postbacks.
You may access the data through grid.Rows collection and with foreach go through each one and change its values and so ..
Hope that helps