Get parent item from grid inside a nestedviewtemplate

3 posts, 1 answers
  1. Felix
    Felix avatar
    42 posts
    Member since:
    Sep 2014

    Posted 08 Sep 2015 Link to this post

    Hello,

     I have a datagrid1 which contains another datagrid2 inside a nestedviewtemplate. With datagrid2 I insert, update and delete records with the help of the different command events.

    How is it possible to get the parent item inside the OnItemCommandEvent, if I click on "Add new record" or on the button inside my GridEditCommandColumn. I tried e.Item.OwnerTableView.ParentItem inside the OnItemCommand-event, but the ParentItem is always null. Thanks in advance.

    Kind regards,
    Felix

  2. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 08 Sep 2015 in reply to Felix Link to this post

    Hello,

    Please look into below link.

    http://www.telerik.com/support/code-library/programmatic-creation-of-radgrid-hierarchy-with-templates

    Above link will help you to how to find the parent grid because based on our structure some time we need to find "Parent" control before finding to ParentItem.

    Let me know if any concern.

     

     

    Thanks, 

    Jayesh Goyani

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Felix
    Felix avatar
    42 posts
    Member since:
    Sep 2014

    Posted 09 Sep 2015 in reply to Jayesh Goyani Link to this post

    Hello Jayesh,

    thanks for your answer. I was hoping that there is an easier way to get the id of the parent item of a nestedviewtemplate. But it seems I have to get a reference to the GridNestedViewItem to get the parent item.

    Regards,
    Felix

Back to Top