c# - GetPostBackClientHyperlink stops when navigating a second grid on the page -
i have 2 grids on page. on pageload both grids have data expected
the first grid has event on rowdatabound
protected void onrowdatabound(object sender, system.web.ui.webcontrols.gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { e.row.attributes["onclick"] = page.clientscript.getpostbackclienthyperlink(gridview1, "select$" + e.row.rowindex); e.row.tooltip = "click select row."; } }
the first grid's row click works expected. when start navigating through second grid using 'next' button, rowclick on first grid stops working. next button click on second grid below
protected void lbtnnext_click(object sender, eventargs e) { try { int pageindex = (int)viewstate["current"] + 1; if (pageindex < grdimages.pagecount) { grdimages.pageindex = pageindex; bindsecondgrid(); viewstate["current"] = pageindex; } else { bindsecondgrid(); } } catch (exception ex) { // catch exception } }
the datasource on second grid different first grid , the databind() on first never called during navigation of second grid. idea wrong?
any idea why happen?
Comments
Post a Comment