Hi, I'm using web grid 11.1 and trying to manage selection on the client side. There are two grids that should exclude each other selections, if grid one has selection then grid two can't have any rows selected.
After grids are loaded if check-box for client side operation is checked it suppose to work in disconnected mode not posting back until user finishes multiple selections and presses the refresh button. To achieve this I added the handler to select change event on grid one (code below) and if grid one has selection I'm trying to clear grid two (one row only). Upon click on refresh button, I expected in code behind selected rows from grid one but there were none. When excludes selection clear on grid two there are selected rows in both grids. Looks like igtbl_clearSelectionAll("grd1T") removes selected rows on all grids and I'm not sure how to prevent it.
Any help would be greatly appreciated.
function grd_AfterSelectChangeHandler(gridName, rowId) {
//Add code to handle your event here.
var chkBx = document.getElementById('chkAutorefresh');
if (chkBx.checked) {
var grid = igtbl_getGridById("grd1");
grid.NeedPostBack = false;
grid.CancelPostBack = true;
igtbl_clearSelectionAll("grd1T");
igtbl_updatePostField("grd1T");
}
Hello Branko,Please take a look at the attached sample created via NetAdvantage 11.1.20111.2064 (latest service release for the moment) and tested with IE 9. I have removed the ig_res folder in order to make archive smaller. It works as expected from you – when the checkbox is checked only one UWG can have selection, when unchecked both can have. If I misunderstood you please modify the sample or provide a new one implementing your code.
Hi Nikifor,
thanks a lot for your swift reply. It turns out that problem was not at all at the client side but instead in the code behind. What I did not know is that even if you handle grid on the client side, grid events in code behind are fired as well but executed only at the post back. Since I set the break point on the button Refresh event, I cold not see that the grid on select change executed before thus clearing the selection at this time.
Thanks anyways for your help.
Regards,
Bane
Hello Branko,Please let me know if you have any further questions about this issue.
thanks again for your help. It is solved, no further help necessary.
Best regards,