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?