Hello!
the project as the attach picture. When I click on the Create button continuously to creat document,after that, I press F2 to edit documents created, the results of the edit box is empty,why? the problem as the 3.png of the attach file. But after I created the file, use the mouse to click in the edit box next to,as the 1.png attach file, There is no the problem. The mouse does not click elsewhere, always click the Create button, Is previously created file will be the CancelEdit ()?
the xaml code:
When I create the new document, I will set the IsInEditMode=true, and I use MVVM
the project as the attach picture. When I click on the Create button continuously to creat document,after that, I press F2 to edit documents created, the results of the edit box is empty,why? the problem as the 3.png of the attach file. But after I created the file, use the mouse to click in the edit box next to,as the 1.png attach file, There is no the problem. The mouse does not click elsewhere, always click the Create button, Is previously created file will be the CancelEdit ()?
the xaml code:
When I create the new document, I will set the IsInEditMode=true, and I use MVVM
<
UserControl.Resources
>
<
DataTemplate
x:Key
=
"childrenDocument"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Width
=
"24"
Height
=
"24"
Source
=
"/Fujitsu.iDM.View.Impl;component/Icons/128/image-folder.png"
></
Image
>
<
TextBlock
Text
=
"{Binding Name, Mode=TwoWay}"
/>
</
StackPanel
>
</
DataTemplate
>
<
HierarchicalDataTemplate
x:Key
=
"rootDocument"
ItemsSource
=
"{Binding Mode=TwoWay, Path=ChildrenDocuments}"
ItemTemplate
=
"{StaticResource childrenDocument}"
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding Name, Mode=TwoWay}"
/>
</
StackPanel
>
</
HierarchicalDataTemplate
>
<
Style
x:Key
=
"treeViewItemStyle"
TargetType
=
"telerik:RadTreeViewItem"
>
<
Setter
Property
=
"IsInEditMode"
Value
=
"{Binding IsInEditMode, Mode=TwoWay}"
/>
<
Setter
Property
=
"IsSelected"
Value
=
"{Binding IsSelected}"
/>
<
Setter
Property
=
"IsExpanded"
Value
=
"true"
/>
</
Style
>
</
UserControl.Resources
>
<
StackPanel
>
<
telerik:RadTreeView
x:Name
=
"radTreeNav"
PreviewSelectionChanged
=
"RadTreeView_PreviewSelectionChanged"
IsEditable
=
"true"
FontWeight
=
"Normal"
SelectedItem
=
"{Binding NavBarSelectedDocument, Mode=OneWayToSource}"
ItemContainerStyle
=
"{StaticResource treeViewItemStyle}"
IsLineEnabled
=
"True"
ItemTemplate
=
"{StaticResource rootDocument}"
ItemsSource
=
"{Binding RootDocuments}"
>
<
telerik:RadTreeView.ItemEditTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
Image
Width
=
"24"
Height
=
"24"
Source
=
"/Fujitsu.iDM.View.Impl;component/Icons/128/image-folder.png"
></
Image
>
<
TextBox
Text
=
"{Binding Path=Name, Mode=TwoWay}"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:RadTreeView.ItemEditTemplate
>
</
telerik:RadTreeView
>
</
StackPanel
>