Pager extension without template?

2 posts, 0 answers
  1. Gunnar
    Gunnar avatar
    28 posts
    Member since:
    Aug 2009

    Posted 30 Sep 2014 Link to this post

    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?
  2. Eyup
    Admin
    Eyup avatar
    3009 posts

    Posted 03 Oct 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top