This is a migrated thread and some comments may be shown as answers.

RadTreelist - adding new row below the child item

5 Answers 86 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Sindu
Top achievements
Rank 1
Sindu asked on 21 Oct 2011, 07:27 AM

Hi All,

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

Thank You.
 
  
 

 

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 21 Oct 2011, 10:36 AM
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.
0
Sindu
Top achievements
Rank 1
answered on 24 Oct 2011, 05:34 AM


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
0
Tsvetina
Telerik team
answered on 26 Oct 2011, 02:46 PM
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
0
sonam
Top achievements
Rank 1
answered on 08 Nov 2011, 11:29 AM
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.
0
Tsvetina
Telerik team
answered on 08 Nov 2011, 04:02 PM
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
Tags
TreeList
Asked by
Sindu
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Sindu
Top achievements
Rank 1
Tsvetina
Telerik team
sonam
Top achievements
Rank 1
Share this question
or