Filtering Problem

2 posts, 0 answers
  1. Phil
    Phil avatar
    1 posts
    Member since:
    Apr 2013

    Posted 20 Aug 2016 Link to this post

    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:TreeListViewTableDefinition ItemsSource="{Binding Children}"/>

                    <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}"  />

  2. Stefan Nenchev
    Stefan Nenchev avatar
    534 posts

    Posted 23 Aug 2016 Link to this post

    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.

    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.
Back to Top