Edit doesn't work

3 posts, 1 answers
  1. StrandedPirate
    StrandedPirate avatar
    32 posts
    Member since:
    Nov 2007

    Posted 13 Jul 2010 Link to this post

    When I edit a node and click away the text displayed remains the original text and not the new text I entered. My databound object gets updated to the correct value but the display on your treeview remains the old text. This is in the latest build to date. Is there some option I need to switch on?




    <telerik:HierarchicalDataTemplate x:Key="TreeviewTemplate">





    <StackPanel Orientation="Horizontal">





    <TextBlock Text="{Binding Name, Mode=TwoWay}" />















    <telerik:RadTreeView Grid.Column="0" Grid.Row="1" PathSeparator="{Binding Source=tbl_Path, Path=PathSeperator}" ItemTemplate="{StaticResource TreeviewTemplate}"








    ItemsSource="{Binding ElementName=tbl_PathDomainDataSource, Path=Data}"








    SelectedValuePath="PathID" x:Name="FolderTreeView"








    IsLoadOnDemandEnabled="True" LoadOnDemand="tbl_PathRadTreeView_LoadOnDemand"








    IsLineEnabled="False" HorizontalAlignment="Stretch"








    IsEditable="True" ExpanderStyle="{StaticResource ExpanderStyle}" Selected="FolderTreeView_Selected"















  2. Answer
    Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 15 Jul 2010 Link to this post

    Hello Joey,

    The most important things you need to keep in mind when you want to edit a node are:

    1. RadTreeView should have its IsEditable property set to true.
    2. You need to specify an ItemEditTemplate. Most of the time, an ItemEditTemplate looks like this:

    <DataTemplate x:Key="DataItemEditTemplate">
            <TextBox Text="{Binding Name, Mode=TwoWay}" />

    3. Your business object should implement INotifyPropertyChanged.

    I've prepared an example demonstrating how to edit a node. Have a look at it and let me know if it helps.

    All the best,
    Kiril Stanoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. StrandedPirate
    StrandedPirate avatar
    32 posts
    Member since:
    Nov 2007

    Posted 16 Jul 2010 Link to this post

    The partial class that contained the Name field didn't implement INotifyPropertyChanged
    After implementing that interface the edit works as expected now.
Back to Top