2010-07-19 58 views
2

我想雙擊一下radgrid的服務器端selectedindexchanged方法,而不是點擊。是否有可能做到這一點???RadGrid Doubleclick

<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. 

    } 

可以這樣做嗎?要在雙擊上回傳還是有其他選擇?

回答

5

它看起來像enablePostBackOnRowClick屬性與您的clientEvent衝突。在您的RowDblClick js函數,你可以通過調用RadAjaxManager和包括commandArgument到ajaxRequest()方法,如進行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 
    } 
} 
+0

我也這麼認爲。我不認爲有。 – Eric 2010-07-19 18:15:05

+0

我更新了我的帖子,因爲我意識到沒有EnablePostBackOnRowDblClick。我已經實現了上述內容,但是我不知道它是否能夠滿足您的需求。 – Robot 2010-07-19 18:23:44

+0

好的,你說要在RowDblClick函數中執行ajax調用? – Eric 2010-07-19 18:29:17