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

Filtering on a column and including the heirarchy

2 Answers 61 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 09 Aug 2011, 02:51 PM
We have a hierarchical set of classes that all inherit the interface IGenericLineItem.  The interface looks something like:

public interface IGenericLineItem
{
    ...
    string Name { get; }
    IGenericLineItem Parent { get; }
    ObservableCollection<IGenericLineItem> SubItems { get; }
    ...
}

and several classes like

public class TopLevelLineItem : IGenericLineItem
{
    public TopLevelLineItem()
    {
        this.SubItems = // generate collection of SecondLevelLineItems, having each Parent is set to `this`
    }
}
 
public class SecondLevelLineItem : IGenericLineItem
{
    public SecondLevelLineItem()
    {
        this.SubItems = // generate collection of BottomLevelLineItems, having each Parent is set to `this`
 
    }
}
 
public class BottomLevelLineItem : IGenericLineItem
{
    public BottomLevelLineItem()
    {
        this.SubItems = // generate collection of further BottomLevelLineItems, having each Parent is set to `this`
    }
}


So we have in our ViewModel an IEnumerable<IGenericLineItem> that gets bound to a RadTreeListView, with the ChildTableDefinition set up like this:
<telerik:RadTreeListView.ChildTableDefinitions>
    <telerik:TreeListViewTableDefinition ItemsSource="{Binding SubItems}">
    </telerik:TreeListViewTableDefinition>
</telerik:RadTreeListView.ChildTableDefinitions>

We want to be able to filter on the Name column for the top level line items, but we want it to still show the subitems of all the matched top level items.  The default filter is great in that it's only showing the list of top level items, but when it actually filters it doesn't show the hierarchy.  Is there some way to override the filter take what the user entered and amend it with something like 
«CurrentItem».Name «Operator» «Value» || «CurrentItem».GetParentOfType<TopLevelLineItem>().Name «Operator» «Value»

2 Answers, 1 is accepted

Sort by
0
Jessica
Top achievements
Rank 1
answered on 27 Sep 2011, 02:35 PM
I am also looking for this solution. Is it possible in WPF?
0
AKROS
Top achievements
Rank 1
answered on 07 Dec 2011, 10:35 PM
Same question here. It looks like that it's not possible yet :(
Tags
TreeListView
Asked by
Steve
Top achievements
Rank 1
Answers by
Jessica
Top achievements
Rank 1
AKROS
Top achievements
Rank 1
Share this question
or