I have two radgrid controls in a window. Both of the grids initially utilize the same data and both are bound to the underlying data.
In grid1 the last column is a checkbox to which I have attached a click event. What I need to do, because of the way the underlying data will be used, when the checkbox in grid1 is clicked, the corresponding row checkbox in grid2 becomes checked, and I need this to be client-side.
What I have done is use javascript to get the checkbox id, change the reference from grid1 to grid2 and update the related checkbox in grid2 to the checked state of the item in grid1. This works as expected for only the first item in grid1. After some digging, I have found that the checkboxes in grid2 are not numbered in the same fashion as those in grid1, despite having the same columns, data and controls.
For example, the checkbox ID in row0 is grid1_ctl00_ctl04_cbxConfirm. The checkbox in the second grid is grid2_ctl00_ctl04_cbxConfirm. When I look at row1, the source ID is grid1_ctl00_ctl05_cbxConfirm, but the destination is grid2_ctl00_ctl06_cbxConfirm. It seems that checkboxes in grid1 are incremented by 1 for each row, while in grid2, the checkbox ID is being incremented by 2 for each row.
I am not creating any other controls (both grids are identical)
Is there a better way to handle this update?
Is there something I need to look at regarding the control incrementing?
Thanks
In grid1 the last column is a checkbox to which I have attached a click event. What I need to do, because of the way the underlying data will be used, when the checkbox in grid1 is clicked, the corresponding row checkbox in grid2 becomes checked, and I need this to be client-side.
What I have done is use javascript to get the checkbox id, change the reference from grid1 to grid2 and update the related checkbox in grid2 to the checked state of the item in grid1. This works as expected for only the first item in grid1. After some digging, I have found that the checkboxes in grid2 are not numbered in the same fashion as those in grid1, despite having the same columns, data and controls.
For example, the checkbox ID in row0 is grid1_ctl00_ctl04_cbxConfirm. The checkbox in the second grid is grid2_ctl00_ctl04_cbxConfirm. When I look at row1, the source ID is grid1_ctl00_ctl05_cbxConfirm, but the destination is grid2_ctl00_ctl06_cbxConfirm. It seems that checkboxes in grid1 are incremented by 1 for each row, while in grid2, the checkbox ID is being incremented by 2 for each row.
I am not creating any other controls (both grids are identical)
Is there a better way to handle this update?
Is there something I need to look at regarding the control incrementing?
Thanks