Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 78072

Filtering Problem

$
0
0

I am using the TreeListView to display a class hierarchy.  All classes have a base class called Node.  Many parents have children of different types but they are all of type Node. 

The tree displays just fine until I filter on the "FC" column then I get the following exception:  

Additional information: Unable to cast object of type 'TMW.i61850.Model.DataSet' to type 'TMW.i61850.Model.LogicalDevice'.  

The LogicalDevice happens to be the root item in the tree in this case and the DataSet happens to be a grandchild of the LogicalDevice.  Both DataSet and LogicalDevice are of type Node.  

All Column binding is bound to properties that only exist on the Node class.  

<telerik:RadTreeListView ItemsSource="{Binding}"  x:Name="TreeView" Grid.Row="1" IsFilteringAllowed="True"  AutoGenerateColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False"

            CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed" BeginningEdit="BeginningEdit"  CellEditEnded="CellEditEnded" DistinctValuesLoading="TreeView_DistinctValuesLoading">
            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}"/>
            </telerik:RadTreeListView.ChildTableDefinitions>

            <telerik:RadTreeListView.Columns>
                <telerik:GridViewDataColumn  Header="Name" Width="300" DataMemberBinding="{Binding Name}"  />
                <telerik:GridViewDataColumn  Header="Value" Width="200" DataMemberBinding="{Binding Value}" />
                <telerik:GridViewDataColumn  Header="FC"  Width="200" DataMemberBinding="{Binding FC}"  />
            </telerik:RadTreeListView.Columns>
        </telerik:RadTreeListView>


Viewing all articles
Browse latest Browse all 78072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>