2

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?

Eric
  • 7,930
  • 17
  • 96
  • 128

1 Answers1

5

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
  • 86
  • 4
  • I thought that too. I don't think there is. – Eric Jul 19 '10 at 18:15
  • 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 Jul 19 '10 at 18:23
  • Ok you're saying to perform the ajax call in the RowDblClick function?? – Eric Jul 19 '10 at 18:29
  • Yes...in your js RowDblClick function, call the RadAjaxManager line I included first. – Robot Jul 19 '10 at 18:32