Hi,
I am using following code to bind data to tree view. Each node in tree view is bound to business object "Node".
<telerik:RadTreeView HorizontalAlignment="Left"
x:Name="uxOrgTree"
Width="Auto"
Height="Auto"
d:LayoutOverrides="Height"
VerticalAlignment="Top"
Margin="0,0,0,0"
SelectionMode="Single"
IsEditable="True"
ItemsSource="{Binding RootNodes}" >
<telerik:RadTreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Entities:Node}" ItemsSource="{Binding Children}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path= Name}"/>
</StackPanel>
</HierarchicalDataTemplate>
</telerik:RadTreeView.Resources>
<telerik:RadTreeView.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<EventSetter Event="Edited" Handler="RadTreeViewItem_Edited" />
</Style>
</telerik:RadTreeView.ItemContainerStyle>
</telerik:RadTreeView>
Now when i press F2 or call SelectedItem.BeginEdit() programmatically, i see datacontext which is Entities.Node in my case, in the edit area and the TextBlock defined in the HierarchicalDataTemplate is displayed next to edit area. I want to edit text in the textblock. How can i do it?
Thanks
Sonal
I am using following code to bind data to tree view. Each node in tree view is bound to business object "Node".
<telerik:RadTreeView HorizontalAlignment="Left"
x:Name="uxOrgTree"
Width="Auto"
Height="Auto"
d:LayoutOverrides="Height"
VerticalAlignment="Top"
Margin="0,0,0,0"
SelectionMode="Single"
IsEditable="True"
ItemsSource="{Binding RootNodes}" >
<telerik:RadTreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type Entities:Node}" ItemsSource="{Binding Children}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Path= Name}"/>
</StackPanel>
</HierarchicalDataTemplate>
</telerik:RadTreeView.Resources>
<telerik:RadTreeView.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadTreeViewItem}">
<EventSetter Event="Edited" Handler="RadTreeViewItem_Edited" />
</Style>
</telerik:RadTreeView.ItemContainerStyle>
</telerik:RadTreeView>
Now when i press F2 or call SelectedItem.BeginEdit() programmatically, i see datacontext which is Entities.Node in my case, in the edit area and the TextBlock defined in the HierarchicalDataTemplate is displayed next to edit area. I want to edit text in the textblock. How can i do it?
Thanks
Sonal