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

Pager extension without template?

1 Answer 37 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Gunnar
Top achievements
Rank 1
Gunnar asked on 30 Sep 2014, 08:01 AM
Is there any easy way to add some additional controls on the pager without using a template and (thereby) redefine the complete pager?

Today I have a DropDown where the user can select to what depth the TreeList should be expanded. It would be very nice if I in some way could have this dropDown located on the Pager instead of outside of the TreeList control, but I don't want to redefine the complete Pager with all it's current controls, just add one extra on the existing line. I've attached a screen shot indication what I want to do.

What is the simplest way of doing this?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 03 Oct 2014, 07:59 AM
Hello Gunnar,

You can use the following approach to achieve the requested functionality:
protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
{
    if (e.Item is TreeListPagerItem)
    {
        Panel container = e.Item.FindControl("PageSizeComboBox").Parent as Panel;
        RadComboBox combo = new RadComboBox()
        {
            ID = "RadComboBox1",
            Label = "Expand to level: "
        };
        combo.DataBinding += (s, a) =>
        {
            combo.DataSource = new string[] { "One", "Two", "Three" };
        };
        container.Controls.Add(combo);
    }
}

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TreeList
Asked by
Gunnar
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or