Radgrid inside Editform Template of Parent Grid causes Parent Grid to rebind.

6 posts, 1 answers
  1. Jeff H.
    Jeff H. avatar
    14 posts
    Member since:
    Jun 2013

    Posted 26 Nov 2013 Link to this post

    I have an RadGrid with an Editform template that contains a RadAjaxPanel control with a sub-gird inside panel. I am using the RadAjaxPanel to help eliminate the page refresh when performing updates to the data inside the editform template.  I use a RadAjaxLoadingPanel with all default values so that when the sub-grid is updated the loading image shows and the whole page will not refresh.  However, I noticed that if I refresh or rebind the sub-grid it causes the parent grid to refresh as well.  So the setup looks something like this.

    <telerik:RadGrid ID="MyParentGrid ... >
       {Databound Columns}
       ...
      <EditFormSettings EditFormType="Template" EditColumn-HeaderButtonType="LinkButton">
          <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                    <FormTemplate> 
                       <telerik:RadAjaxPanel ID="EditArea" runat="server" Visible='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "false", "true") %>'  BorderStyle="Solid" BorderWidth="1px" LoadingPanelID="RadAjaxLoadingPanel1"> 
                                              
                                               <telerik:RadGrid ID="MyChildGrid" ... >
                                               </telerik:RadGrid>

                       </telerik:RadAjaxPanel...>
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
                        </telerik:RadAjaxLoadingPanel>
                    </FormTemplate> 
             </EditFormSettings>
    </telerik:RadGrid>

    Is there something I need to do to isolate the update of the sub-grid from the parent grid?  Do I need an AjaxManager inside the EditForm Template?

    Thanks in Advance,

    Jeff
  2. Eyup
    Admin
    Eyup avatar
    3008 posts

    Posted 29 Nov 2013 Link to this post

    Hi Jeff,

    I have created a sample RadGrid web site to test the described behavior. Can you please run the attached application and instruct me the exact steps I need to take to reproduce the issue locally?

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jeff H.
    Jeff H. avatar
    14 posts
    Member since:
    Jun 2013

    Posted 03 Dec 2013 Link to this post

    Eyup,

    After tinkering with your example it still wouldn't match what I have in my edit form,  At any rate I was able to get around this by using some flags to indicate when to refresh the main grid.

    Thanks,
    Jeff
  5. Eyup
    Admin
    Eyup avatar
    3008 posts

    Posted 06 Dec 2013 Link to this post

    Hi Jeff,

    I am glad you have managed to resolve the issue. You can also check out the following sample:
    http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/partialajaxification/defaultcs.aspx

    Hope this helps.

    Regards,
    Eyup
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. MV
    MV avatar
    21 posts
    Member since:
    Dec 2015

    Posted 20 Oct Link to this post

    Hi,

    I have RadGrid2 and UC1 (user control) inside RadGrid1 Edit Form Template. My user control inserts data which I display using RadGrid2. I'm trying to refresh RadGrid2 automatically after UC1 is done. And the other way, if I update/delete items from RadGrid2, I want to be able to refresh my UC1.How can I accomplish this?

    (My user control is an image. When I click the image, a Radwindow appears, inserts then closes. I have 2 images, if there is data on the grid, I display a populated note, if there is nothing then I display an empty note.)

    Thanks in advance.

     

  7. Answer
    Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 25 Oct Link to this post

    Hi,

    Note that the RadGrid is a complex control and needs to be refreshed as a whole. Thus, updating only parts of the Grid is not available out of the box. This is why the Parent grid is refreshed after you update the inner Grid.

    With that said, if you would like to show hierarchical data I would recommend using the built-in hierarchy support for RadGrid.

    If I understand your scenario correctly. The UserControl would be a custom edit form for RadGrid2. If that is the case, you can use an approach similar to the following in order to have them work together:


    Please refer to the following article that elaborates in more detail on how you can update values in the grid via UserControl edit form.



    Regards,
    Viktor Tachev
    Telerik by Progress
    Check out the new UI for ASP.NET Core, the most complete UI suite for ASP.NET Core development on the market, with 60+ tried-and-tested widgets, based on Kendo UI.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017