TreeListView Row Visibility

2 posts, 0 answers
  1. Arinto
    Arinto avatar
    25 posts
    Member since:
    Nov 2010

    Posted 09 Mar 2011 Link to this post

    Hi there, 

    Is that possible to bind the Visibility property of TreeListView Row into a ViewModel's property?

    For example here is the format of the ViewModel
    public class EntryViewModel
        private String _name;
        private ObservableCollection<EntryViewModel> _items;
        private Boolean _isVisible;
        public EntryViewModel(String name, Boolean isVisible = true)
            _name = name;
            _items = new ObservableCollection<TSEntryViewModel>();
            _isVisible = isVisible;
        public String Name
            get { return _name;}
            set { _name = value; }
        public ObservableCollection<EntryViewModel> Items
            get { return _items; }
            set { _items = value; }
        public Boolean IsVisible
            get { return _isVisible; }
            set { _isVisible = value; }

    So, is that possible to set the Visibility  property of TreeListView row to Collapsed when IsVisible value is false?
    I've tried to look for some APIs here but can't find any API that can serve my purpose.



  2. Ivan Ivanov
    Ivan Ivanov avatar
    1216 posts

    Posted 11 Mar 2011 Link to this post

    Hello Arinto,

    Modifying rows' Visibility will most likely result in the appearance of blank spaces into your TreeListView and other severe visual issues. As a rule of thumb, directly messing with the visual tree is rarely a good idea. I would strongly advise you to utilize a filtering approach, in order to display only the items that satisfy your condition. 

    Ivan Ivanov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top