How create custom treeview for RadListFilterPopup?

2 posts, 0 answers
  1. Stanley
    Stanley avatar
    32 posts
    Member since:
    Apr 2012

    Posted 08 Jun 2012 Link to this post

    First, I have prepared my data in a radTreeView control.
    Then, how assign treeview to RadListFilterPopup?


    Please refer the pciture from attachment.
    Any way can be done?


    RadHostItem h = new RadHostItem(this.radTreeView1);


    void radGridView1_FilterPopupRequired2(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e)
    {
        if (e.Column.Name == "Store")
        {
            e.FilterPopup = new RadListFilterPopup(this.radTreeView1, true);
        }
    }
  2. Stefan
    Admin
    Stefan avatar
    2908 posts

    Posted 13 Jun 2012 Link to this post

    Hello Stanley,

    Thank you for writing.

    The tree in RadListFilterPopup cannot be replaced, however it can be accessed and modified. Here is a sample, where I am clearing all nodes and I am adding new ones:
    void radGridView1_FilterPopupRequired(object sender, Telerik.WinControls.UI.FilterPopupRequiredEventArgs e)
    {
        if (e.Column.Name == "Name")
        {
            RadListFilterPopup popup = e.FilterPopup as RadListFilterPopup;
            popup.MenuTreeElement.TreeView.Nodes.Clear();
            for (int i = 0; i < 10; i++)
            {
                popup.MenuTreeElement.TreeView.Nodes.Add("Node Name " + i);
            }
        }
    }

    I hope this helps. Let us know if you have any other questions.
     
    Greetings,
    Stefan
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Back to Top