Filter Rows

1 posts, 0 answers
  1. Jaime Weise
    Jaime Weise avatar
    25 posts
    Member since:
    Nov 2008

    Posted 24 Sep 2011 Link to this post

    Trouble Filtering Rows.
    I have the need to bind a viewmodel that has a hierarchy of objects in the template for the TreeListView. I have a need to make rows(nodes) toggle between visible or invisible while in "ShowAll" mode where all the nodes can be seen. The user clicks the show all checkbox outside of the treeview to enter show all mode. There is an eye icon beside every treelistivew item kind of like adobe products have. The eye once clicked will turn from gray to a selected state to show that he item is visible. Once the ShowAll mode is turned off the items should be filtered from view. I can't work this out.

     <CheckBox x:Name="ShowAll" Content="Show All" Click="ShowAll_Click" ></CheckBox>
    telerik:RadTreeListView x:Name="MyTreeView" EditTriggers="None"
                             local:SelectionBehavior.SelectionChanged="{Binding Path=ItemSelectedCommand}"
                             ItemsSource="{Binding ProjectDataInstances}"
            <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children, Converter={StaticResource NodeVisibilityConverter1}}" />

    The converter can work on my IsVisible variable internally for each of my children but there is no way to check the show all control from the TreeListViewTableDefinitino.ItemsSource as it passes through the converter(I could flag the converter to show everything). I tried to use a Multibinding which doesn' t work. I also tried to pass the Element in the ConverterParameter but that doesn't work either. I toyed with polluting my viewmodel with a static ShowAll property and manually walking the hierarchy and updating the IsVisible properties using that property flag but I am having troubles with that too.

     So, naturually my question is, how do I properly filter the rows? 

Back to Top