我想在doubleclick上关闭radgrid的服务器端selectedindexchanged方法而不是点击。是否可以这样做?
<telerik:RadGrid ID="RadGridCashier" runat="server" AllowMultiRowSelection="False" DataSourceID="SqlDataSourceCashier" Skin="WebBlue" AutoGenerateColumns="false" AllowFilteringByColumn="true"
AllowPaging="True" AllowSorting="true" GroupingSettings-CaseSensitive="false" OnDataBound="RadGridCashier_DataBound" OnSelectedIndexChanged="RadGridCashier_SelectedIndexChanged" >
<MasterTableView DataKeyNames="rouse_location,operator_no" >
<Columns>
//columns go here
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
<Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>
function RowDblClick(sender, eventArgs) {
Row= eventArgs.get_itemIndexHierarchical();
// here is where i want to fire off selectedindexchanged somehow.
}
有可能这样做吗?要在doubleclick上回发还是有替代方案?
答案 0 :(得分:5)
看起来enablePostBackOnRowClick属性与您的clientEvent冲突。在RowDblClick js函数中,您可以通过调用RadAjaxManager并将commandArgument包含在ajaxRequest()方法中来执行ajax调用,例如:
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("SelectedIndexChanged");
然后在代码后面,处理RadAjaxManager AjaxRequest事件:
protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if (e.Argument == "SelectedIndexChanged")
{
//Do Something
}
}