"Object does not match target type" error while editing radtreelistview

3 posts, 1 answers
  1. Sharada
    Sharada avatar
    43 posts
    Member since:
    Mar 2009

    Posted 21 Mar 2011 Link to this post

    Hi,
    I'm  trying to display two datatypes in a RadTreeListView through XML. The first datatype, 'Director', with two properties: 'Name', and a property 'Function' . Function contains two properties i.e Name and FunctionType.


    --------------------------------------------------------------------------------------------------
    public
    class Director
    {
        public string Name{ get; set; }
        public ObservableCollection<Function > Function { get; set; }
    }
     
    public class Function
    {
        public string Name { get; set; }
        public string FunctionType{ get; set; }
     }

     

     

     

    <Window.Resources>

     

     

     

    <local:RadTreeListXmlDataSource x:Key="TreeSource" Source="TestData.xml" />

     

     

     

     

     

    </Window.Resources>

     

     

     

     

     

     

     

      <telerik:RadTreeListView CellEditEnded="RadTreeListView1_CellEditEnded" x:Name="RadTreeListView1" RowIsExpandedChanged="RadTreeListView1_RowIsExpandedChanged"

     

     

     

     

      AutoGenerateColumns="False" ItemsSource="{StaticResource TreeSource}">

     

     

     

     

      <telerik:RadTreeListView.ChildTableDefinitions>

     

     

     

     

      <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />

     

     

     

     

      </telerik:RadTreeListView.ChildTableDefinitions>

     

     

     

     

      <telerik:RadTreeListView.Columns>

     

     

     

     

      <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />

     

     

     

     

      <telerik:GridViewDataColumn DataMemberBinding="{Binding Source}" Header="Type" />

     

      

     

    </telerik:RadTreeListView.Columns>

     

     

     

     

    </telerik:RadTreeListView>

     




    -------------------------------------------------------------------------------------------------

    I was able to edit the Director's properties but when I tried to edit Function's properties i.e Funnction Name ,
    I got an error saying "Object does not match target type".
    Can you please provide a sample for the above functionality?


  2. Answer
    Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 21 Mar 2011 Link to this post

    Hello,

     This is already fixed in our latest official release - Q1 2011. 

    Regards,
    Vlad
    the Telerik team
  3. UI for WPF is Visual Studio 2017 Ready
  4. Sharada
    Sharada avatar
    43 posts
    Member since:
    Mar 2009

    Posted 22 Mar 2011 Link to this post

    Thanks for the reply.
Back to Top