I want to filter the items displayed in a RadTreeView based on the value of a property set on each item. I'd like to have the tree view reflect the current state of its items whenever this property is changed. Is this possible?
This is what I've tried so far but I don't know enough about how QueryableCollectionView and FilterDescriptors work to know that I'm using it properly.
This is what I've tried so far but I don't know enough about how QueryableCollectionView and FilterDescriptors work to know that I'm using it properly.
public
class
Node
{
public
string
Name {
get
;
set
; }
public
bool
IsVisible {
get
;
set
; }
public
Node(
string
name,
bool
isVisible)
{
this
.Name = name;
this
.IsVisible = isVisible;
}
}
ObservableCollection<Node> nodes =
new
ObservableCollection<Node>();
QueryableCollectionView items =
new
QueryableCollectionView(nodes);
items.FilterDescriptors.Add(
new
FilterDescriptor(
"IsVisible"
, FilterOperator.IsEqualTo,
true
,
false
,
typeof
(
bool
)
)
);