Nested Listview

2 posts, 0 answers
  1. Javier Gonzalez de Aragon
    Javier Gonzalez de Aragon avatar
    35 posts
    Member since:
    Mar 2010

    Posted 09 Feb Link to this post

    Is nit possible to nest a listview within another listview using custom items?

     

    Thanks

  2. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 10 Feb Link to this post

    Hello Javier,

    Thank you for writing.

    Yes this is possible, you should use RadHostItem to add the control:
    public class MyCustomVisualItem : SimpleListViewVisualItem
    {
        RadListView  listview = new RadListView ();
     
        protected override void CreateChildElements()
        {
            base.CreateChildElements();
           
            for (int i = 0; i < 5; i++)
            {
                listview.Items.Add("Item " + i);
            }
            RadHostItem host = new RadHostItem(listview);
            this.Children.Add(host);
        }
     
        protected override Type ThemeEffectiveType
        {
            get
            {
                return typeof(SimpleListViewVisualItem);
            }
        }
    }

    Let me know if I can assist you further.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top