怎麽觸發gridview 的SelectedIndexChanged事件?
阿新 • • 發佈:2018-10-06
rip exc function onclick ble select can nat UNC
<asp:GridView onclick="javascript:SelectedIndexChanged()" ID="GridView1" runat="server">
</asp:GridView>
<script type="text/javascript">
function SelectedIndexChanged()
{
event.cancelBubble=true;
var the_obj = event.srcElement;
if(the_obj.tagName.toLowerCase() != "table" && the_obj.tagName.toLowerCase() != "tbody" && the_obj.tagName.toLowerCase() != "tr")
{
cur_row = the_obj.parentElement.rowIndex;
if(cur_row!=0)
{
__doPostBack("GridView1",cur_row);
}
}
}
</script>
怎麽觸發gridview 的SelectedIndexChanged事件?