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

Filtering Problem

1 Answer 154 Views
TreeListView
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 20 Aug 2016, 04:03 PM

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>

1 Answer, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 23 Aug 2016, 12:00 PM
Hi Phil,

I tried reproducing the issue you have described but unfortunately did not observe a similar exception in an analogous scenario. The best approach would be if you can provide us with a sample project that shows the undesired behavior so we can investigate it in details. Please raise a ticket with such so we can advise you accordingly.

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeListView
Asked by
Phil
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Share this question
or