Filtering problem

2 posts, 0 answers
  1. Dan
    Dan avatar
    2 posts
    Member since:
    Sep 2010

    Posted 15 Sep 2010 Link to this post

    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}" />







    in C# code I bind is to ItemSource:

    _branchTree = e.Result as BranchTransportCollection;
    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

  2. Hristo
    Hristo avatar
    352 posts

    Posted 20 Sep 2010 Link to this post

    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
  3. DevCraft R3 2016 release webinar banner
Back to Top