views:

257

answers:

1

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?

+2  A: 

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
    }
}
Robot
I thought that too. I don't think there is.
Eric
I updated my post as I realized there is no EnablePostBackOnRowDblClick. I've implemented the above but I don't know if it will get you what you need.
Robot
Ok you're saying to perform the ajax call in the RowDblClick function??
Eric
Yes...in your js RowDblClick function, call the RadAjaxManager line I included first.
Robot