This question is locked. New answers and comments are not allowed.
We have a hierarchical set of classes that all inherit the interface IGenericLineItem. The interface looks something like:
and several classes like
So we have in our ViewModel an IEnumerable<IGenericLineItem> that gets bound to a RadTreeListView, with the ChildTableDefinition set up like this:
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
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:TreeListViewTableDefinitionItemsSource="{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»