RadGrid 双击

发布于 2024-09-10 19:54:58 字数 1303 浏览 4 评论 0原文

我想在双击而不是单击时触发 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人间☆小暴躁 2024-09-17 19:55:00

看起来 enablePostBackOnRowClick 属性与您的 clientEvent 冲突。在 RowDblClick js 函数中,您可以通过调用 RadAjaxManager 并向 ajaxRequest() 方法添加 commandArgument 来执行 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
    }
}

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:

$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("SelectedIndexChanged");

Then in code behind, handle the RadAjaxManager AjaxRequest event:

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    if (e.Argument == "SelectedIndexChanged")
    {
        //Do Something
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文