Radgrid with radgrid on the edit template

3 posts, 0 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 07 Nov 2008 Link to this post

    Hi Telerik,

    Yesterday I encountered a problem, it seems a little bug.

    Scenario: I have a grid with a popup edit. In the edit template i have an other grid with paging on. The user can select an item (over 1500 rows...)
    All well, but: The main grid has
    EnablePostBackOnRowClick="true" 
    while the secound grid in the popup edit "window" has not.

    Behaviour: the secound grid is posting back on row click!
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 10 Nov 2008 Link to this post

    Hello Proovit,

    Indeed, this issue is present.
    I have alerted our developers, and they will soon look into this issue.

    Kind regards,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 01 Dec 2008 Link to this post

    Hi Proovit,

    Here is the promised follow up.
    Presently, there is no option to automatically handle this scenario.
    However, here is one option.
    You can use the onclick handler for the inner grid to cancel out the bubbling of the rowclick. This may look something like this:

    .aspx
    <EditItemTemplate> 
                                    <telerik:RadGrid runat="server" ID="RadGrid1" DataSourceID="AccessDataSource1" GridLines="None">  
                                        <HeaderContextMenu EnableTheming="True">  
                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                        </HeaderContextMenu> 
                                        <MasterTableView AutoGenerateColumns="False" DataKeyNames="CategoryID" DataSourceID="AccessDataSource1">  
                                            <RowIndicatorColumn> 
                                                <HeaderStyle Width="20px" /> 
                                            </RowIndicatorColumn> 
                                            <ExpandCollapseColumn> 
                                                <HeaderStyle Width="20px" /> 
                                            </ExpandCollapseColumn> 
                                            <Columns> 
                                                <telerik:GridEditCommandColumn> 
                                                </telerik:GridEditCommandColumn> 
                                                <telerik:GridBoundColumn DataField="CategoryID" DataType="System.Int32" HeaderText="CategoryID" 
                                                    ReadOnly="True" SortExpression="CategoryID" UniqueName="CategoryID">  
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" 
                                                    UniqueName="CategoryName">  
                                                </telerik:GridBoundColumn> 
                                            </Columns> 
                                        </MasterTableView> 
                                        <FilterMenu EnableTheming="True">  
                                            <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                        </FilterMenu> 
                                        <ClientSettings> 
                                            <ClientEvents OnRowClick="rowClick" /> 
                                        </ClientSettings> 
                                    </telerik:RadGrid> 
                                    <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/Nwind.mdb" 
                                        SelectCommand="SELECT TOP 3 [CategoryID], [CategoryName], [Description] FROM [Categories]">  
                                    </asp:AccessDataSource> 
                                </EditItemTemplate> 
                            </telerik:GridTemplateColumn> 

    .Js
      <script type="text/javascript">  
                      
                    function rowClick(sender, eventArgs)  
                    {  
                    if(!e) var e = window.event;                      
                        e.cancelBubble = true;  
                        e.returnValue = false;       
                    }  
            
                </script> 

    I hope this helps.

    Sincerely yours,
    Yavor
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top