RadTreelist - adding new row below the child item

6 posts, 0 answers
  1. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 21 Oct 2011 Link to this post


    Hi All,

      I want to add a new row  below the child item when expand a  Parent item.
      How is it possible?

    Thank You.
     
      
     

     
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Oct 2011 Link to this post

    Hello Sindu,

    You can try the following code to add new row when expanding the Parent item.

    C#:
    protected void RadTreeList1_ItemCommand(object sender, TreeListCommandEventArgs e)
    {
     TreeListItem item = e.Item as TreeListItem;
     if (e.CommandName ==RadTreeList.ExpandCollapseCommandName)
      {
        e.Item.FireCommandEvent("InitInsert", null);
      }
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sindu
    Sindu avatar
    46 posts
    Member since:
    Oct 2011

    Posted 24 Oct 2011 Link to this post



    Hi Princy,

     when I used the following code as you suggested ,I can add a new row just below the parent.But I  need to add a new row

     below the child item.suppose a parent has 3 child ,then I  want to add a new row after these 3 child item.

     Also This code add a row in the form of insert ,cancel .

    protected void RadTreeList1_ItemCommand(object sender, TreeListCommandEventArgs e)
    {
     TreeListItem item = e.Item as TreeListItem;
     if (e.CommandName ==RadTreeList.ExpandCollapseCommandName)
      {
        e.Item.FireCommandEvent("InitInsert", null);
      }

    }


    Please help me


    Thanks
  5. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 26 Oct 2011 Link to this post

    Hello Sindu,

    Currently RadTreeList does not offer such functionality to choose the position of the insert form. As for your second concern, I do not fully understand it. Do you want the control to show a new row in browse mode?
    If so, you would need to do an insert in the database, taking care of providing the corrent parent key value, so the item appears as a child of the correct parent.

    Kind regards,
    Tsvetina
    the Telerik team
    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 their blog feed now
  6. sonam
    sonam avatar
    19 posts
    Member since:
    Jan 2011

    Posted 08 Nov 2011 Link to this post

    Hi,

    I  have a radtreelist. what i want is ,to add child row dynamically when expand(+) button get clicked not before that.similary the child rows get cleared when i reclick expand button to collapse the child rows.
    also i want to show a button control only in child rows not in parent rows .
    please help me out to acheive these two requirements as soon as possible.
    thanks.
  7. Tsvetina
    Admin
    Tsvetina avatar
    1876 posts

    Posted 08 Nov 2011 Link to this post

    Hi Sonam,

    You can use the Load-On-Demand functionality of RadTreeList in order to assign the children items of a parent only when it is expanded:
    TreeList / Load on Demand (online demo)

    As for the button, you can see this topic in order to see how different parts of the control can be accessed:
    Accessing Cells and Items
    In order to differentiate the items' levels, you could use the HierarchyIndex.NestedLevel property of the TreeListDataItem.

    Greetings,
    Tsvetina
    the Telerik team
    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 their blog feed now
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017