如何在telerik radgrid中双击执行服务器端代码?我的radgrid上有一个radbutton执行服务器端代码,我想在一行上双击以执行相同的代码。
<script type="text/javascript">
function RowDblClick(sender, eventArgs) {
// do post back? find button and call the click function?
}
</script>
<telerik:RadGrid ID="RadGrid1" runat="server">
<ClientSettings>
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
<MasterTableView CommandItemDisplay="Top">
<CommandItemTemplate>
<telerik:RadButton ID="EditRadButton" runat="server" Text="Edit" />
</CommandItemTemplate>
</MasterTableView>
</telerik:RadGrid>
答案 0 :(得分:1)
获取网格,然后获取其子项按钮,然后调用单击
function RowDblClick(sender, eventArgs) {
var grid = $get('<%= RadGrid1.ClientID %>');
var button = $telerik.findControl(grid, "EditRadButton");
button.click();
}