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

TreeListView Row Visibility

1 Answer 112 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Arinto
Top achievements
Rank 1
Arinto asked on 10 Mar 2011, 03:51 AM
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.
http://www.telerik.com/help/wpf/telerik.windows.controls.gridview-telerik.windows.controls.radtreelistview_members.html


Regards, 

Arinto



1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 11 Mar 2011, 05:06 PM
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. 


Greetings,
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!
Tags
TreeListView
Asked by
Arinto
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or