Dear,
According the instuction of using RadTreeView (refer to Operation not supported on read-only collection) , in case using the ItemSource of TreeView, we must modify the underling collection to add/ remove items of controls.
But that does not work ( the treeView does not synchonize data with the underlying binding item source).
Please get these example with ORANGAZIATION type has ORG_ID and ORG_NAME properties:
SilverLight1.xaml: have a RadTreeView and a Button to remove each item of underlying source on each click
<telerikNavigation:RadTreeView Grid.Row="0" Grid.Column="0" x:Name="radtvAssignJob" >
<telerikNavigation:RadTreeView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<TextBlock VerticalAlignment="Center" Text="{Binding JAB_NAME}" Width="Auto" TextWrapping="Wrap"></TextBlock>
</StackPanel>
</DataTemplate>
</telerikNavigation:RadTreeView.ItemTemplate>
</telerikNavigation:RadTreeView>
SilverLight1.xaml.cs
List<ASSIGNJOBSWCFService.JOBABILITIES> lst = new List<CMS.UC.ASSIGNJOBSWCFService.JOBABILITIES>();
public SilverlightControl1()
{
InitializeComponent();
}
private void UserControl_Loaded(object sender, RoutedEventArgs e)
{
ASSIGNJOBSWCFService.JOBABILITIES itm ;
for ( int i = 0 ; i < 10 ; i ++)
{
itm = new CMS.UC.ASSIGNJOBSWCFService.JOBABILITIES();
itm.JAB_NAME = "JAB_NAME" + i;
lst.Add(itm);
}
radtvAssignJob.ItemsSource = lst;
}
private void btnCut_Click(object sender, RoutedEventArgs e)
{
lst.RemoveAt(0);
}
It does not work with purpose of synchonize data with the underlying binding item source whenever node is removed by clicking
Could you help to solve this problem? Thank you for your help
Best regards,
Huy