RadGrid 双击
我想在双击而不是单击时触发 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.
}
可以这样做吗?双击回发还是有其他选择?
I would like to fire off the server side selectedindexchanged method of a radgrid on doubleclick and not on click. Is it possible to do this???
<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.
}
Is it possible to do this? To postback on doubleclick or is there an alternative?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 enablePostBackOnRowClick 属性与您的 clientEvent 冲突。在 RowDblClick js 函数中,您可以通过调用 RadAjaxManager 并向 ajaxRequest() 方法添加 commandArgument 来执行 ajax 调用,例如:
然后在后面的代码中处理 RadAjaxManager AjaxRequest 事件:
It looks like the enablePostBackOnRowClick attribute is conflicting with your clientEvent. In your RowDblClick js function, you could perform an ajax call by calling the RadAjaxManager and including a commandArgument to the ajaxRequest() method such as:
Then in code behind, handle the RadAjaxManager AjaxRequest event: