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

Filtering problem

1 Answer 47 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Dan asked on 15 Sep 2010, 11:37 PM
I'm trying to implement a filter on a treeview but it doesn't work.

Here is what I do:
1. Get a TreeGrapgh collection over WCF. it is a Collection<Node> where node
looks like:

class Branch
{
    string Name { get; set; }
    NodeCollection Children;
}
class BranchCollection : Collection<Branch>
{
}

Then I create a temple in XAML that uses a HierarchicalDataTemplate:

 

 

 

<TelerikWindowsControls:HierarchicalDataTemplate x:Key="BranchTreeTemplate" ItemsSource="{Binding Children}">

 

 

 

 

<TextBlock HorizontalAlignment="Left" Text="{Binding Name}" AutomationProperties.Name="{Binding Name}" />

 

 

 

 

</TelerikWindowsControls:HierarchicalDataTemplate>

 


in C# code I bind is to ItemSource:

_branchTree = e.Result as BranchTransportCollection;
RADTreeView.Items.Clear();
RADTreeView.ItemsSource = _branchTree;


After that on TextChange even on my text box I do this


            var fl = _branchTree.Where(b => b.Name.IndexOf(_filterText) > -1);
            RADTreeView.ItemsSource = null;
            RADTreeView.ItemsSource = fl;

but this doesn't work as expected. the branches are not filtered, I think I get more branches not less.

I'm confused here. Please help

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 20 Sep 2010, 02:20 PM
Hello Dan,

We couldn't simulate the issue you are experiencing. Can you please take a look at the attached project if our scenario is similar. Also can you modify it or attach you own simple project demonstrating the issue.

Sincerely yours,
Hristo Milyakov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
TileView
Asked by
Dan
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or