edit RadRtreeviewItem problem

2 posts, 0 answers
  1. Bill
    Bill avatar
    8 posts
    Member since:
    Dec 2012

    Posted 17 Dec 2012 Link to this post

    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
    <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>
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 19 Dec 2012 Link to this post

    Hi Bill,

    As far as I understand your issue is the following:
    When you add a new RadTreeViewItem and try to edit it, you get an empty TextBox. This can be caused of the type of your business collection. Are you using the ObservableCollection<T> class which supports the two way binding? Also, can you please tell me what is the version of your dlls? Is it possible for you to send us your project so we will be able to investigate this behavior and suggest the best approach for you?

    Regarding your last question, I can not really understand what you want to ask when you say: "Is previously created file will be the CancelEdit ()?". Can you please clarify your point?

    Regards,
    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top