Radgrid parentID javascript

2 posts, 0 answers
  1. John
    John avatar
    10 posts
    Member since:
    Aug 2015

    Posted 06 Oct 2018 Link to this post

    The radgrid has 3 parent tiers before getting to the details. Using a command template I like to create a new detail record by passing parentID. When clicking on add new record, I bring up a radwindow for the user to enter the data in the new record form. The radwind is shown using javascript. 

    I would like to pass the parent ID from the third tier to the new record form. Unfortunately I can not find the parent id using javascript.

    function openConfirmationWindowNEW(sender, args) {

    // ... not working getting parentID "progranID"
    var myprogramID = $find(Telerik.Web.UI.Grid.GetFirstParentByTagName(sender.get_element().parentNode, "ProgramID").id);

    radopen("newrecord.aspx?carID= " + programID , "RadWindow2");

  2. Attila Antal
    Attila Antal avatar
    592 posts

    Posted 10 Oct 2018 Link to this post

    Hi John,

    It happened that I have a sample project with a 2 level hierarchical RadGrid, which has buttons in the DetailTable and if they are getting clicked, they get a reference to the parent item as dataItem, and/or TableView. The same approach can be used to achieve a scenario for a 3 or more level Hierarchical grid.

    Please check out the attached webforms page. All you need is to import it into a Website and run it. Since it has dummy data bound to it, there is no need to setup SQL connection. I've tried to descriptive in the code as much as possible.

    Please let us know if you have questions.

    Kind regards,
    Attila Antal
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top