Master/Detail relationship lost when editing

3 posts, 0 answers
  1. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 29 Oct 2013 Link to this post

    Have two grids with a master/detail relation created per the online example at:
    http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/master-detail/defaultvb.aspx?#qsf-demo-source

    All works well, when records are selected in the master grid, the detail grid updates.

    However, when I place a record in the master grid in edit mode, the relationship to the detail grid is lost, presumably, because the 'SelectedItems' collection within the master grid becomes null (from what I've been able to determine via tracing)... the detail grid then automatically updates and becomes blank, losing the connection between the master and detail grids.

    Is there a way to prevent that from happening? I would like to have the detail data for the record in edit mode appear in the detail grid for reference purposes..
  2. Angel Petrov
    Admin
    Angel Petrov avatar
    1006 posts

    Posted 01 Nov 2013 Link to this post

    Hello Michael,

    The behavior you are experiencing is expected as when an item is opened for edit RadGrid recreates it's structure and clears the selected indexes collection. In order to avoid this you can set the edit item as selected in the PreRender event of the grid and rebind the second RadGrid. Following this approach I have assembled a sample website for you to review. The example should help you modify the real code logic.

    Regards,
    Angel Petrov
    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. ToltingColtAcres
    ToltingColtAcres avatar
    83 posts
    Member since:
    Nov 2010

    Posted 01 Nov 2013 Link to this post

    Works. Awesome. Thanks.
Back to Top