OnRowDblClick do not work with GridTemplateColumn

2 posts, 0 answers
  1. Imran Javed Zia
    Imran Javed  Zia avatar
    55 posts
    Member since:
    Jul 2009

    Posted 01 Jul 2010 Link to this post


    We are using RadGrid with GridTemplateColumn which has a table in it with multiple controls. And handling OnRowSelected and OnRowDblClick client side events.
    When user clicks some area in table then OnRowDblClick not fired while OnRowSelected works properly. as a work around we used a div outside the table with ondblclick event.

    Is there anyother better solution for this as we are getting some other limitation and problem by handling double click through div?


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2010 Link to this post

    Hello Imran,

     I also experienced this issue when i tried in my end. As a workaround access the GridTemplateColumn from code behind and attach 'ondblclick' client event by passing the ItemIndex to event handler. In the event handler identify the corresponding grid row using this ItemIndex value.

     <telerik:GridTemplateColumn HeaderText="TemplateColumn" UniqueName="GridTemplateColumn"
          <table width="100%" style="height: 100%;"
                  <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 
                  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 

     protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
            if (e.Item is GridDataItem) 
                GridDataItem item = (GridDataItem)e.Item; 

    Java Script:
     <script type="text/javascript"
          function DblClick(index) 
            var grid = $find("<%=RadGrid1.ClientID %>"); 
            var MasterTable = grid.get_masterTableView(); 
            var dataItem = MasterTable.get_dataItems()[index];// access grid DataItem using 'index' 

    Hope this helps,

Back to Top