开发者

RadGrid Doubleclick

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?


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
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜