Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Member
271 Points
528 Posts
Apr 29, 2012 11:10 AM|LINK
Hello Guys!
Highlighting selected rows with this codes via onRowDatabound event.
But when i checking Checkbox (after Postback) row highlight function dont work.
any advice?
Thanks in advance!
<script language="javascript" type="text/javascript" id="Script1"> var gridViewCtlId2 = '<%=gvSelected.ClientID%>'; var gridViewCtl2 = null; var curSelRow2 = null; var rowHighLightTimeOut2 = null; function getGridViewControl2() { if (null == gridViewCtl2) { gridViewCtl2 = document.getElementById(gridViewCtlId2); } } function onGridViewRowSelected2(rowIdx2) { var selRow2 = getSelectedRow2(rowIdx2); if (curSelRow2 != null) { curSelRow2.style.backgroundColor = '#ffffff'; } if (null != selRow2) { curSelRow2 = selRow2; curSelRow2.style.backgroundColor = '#ababab'; } } function getSelectedRow2(rowIdx2) { getGridViewControl2(); if (null != gridViewCtl2) { return gridViewCtl2.rows[rowIdx2]; } return null; } </script>
omerdemir
Member
271 Points
528 Posts
JavaScript Function Dont Work After PostBack!
Apr 29, 2012 11:10 AM|LINK
Hello Guys!
Highlighting selected rows with this codes via onRowDatabound event.
But when i checking Checkbox (after Postback) row highlight function dont work.
any advice?
Thanks in advance!
<script language="javascript" type="text/javascript" id="Script1"> var gridViewCtlId2 = '<%=gvSelected.ClientID%>'; var gridViewCtl2 = null; var curSelRow2 = null; var rowHighLightTimeOut2 = null; function getGridViewControl2() { if (null == gridViewCtl2) { gridViewCtl2 = document.getElementById(gridViewCtlId2); } } function onGridViewRowSelected2(rowIdx2) { var selRow2 = getSelectedRow2(rowIdx2); if (curSelRow2 != null) { curSelRow2.style.backgroundColor = '#ffffff'; } if (null != selRow2) { curSelRow2 = selRow2; curSelRow2.style.backgroundColor = '#ababab'; } } function getSelectedRow2(rowIdx2) { getGridViewControl2(); if (null != gridViewCtl2) { return gridViewCtl2.rows[rowIdx2]; } return null; } </script>