This is a migrated thread and some comments may be shown as answers.

Insert items in edit mode problem

5 Answers 148 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Lauren Nickerson
Top achievements
Rank 1
Lauren Nickerson asked on 29 Dec 2009, 11:17 PM
Hello.

As the title says, I'm trying to set a node to edit mode as soon as it's created. The approach I'm using is through WPF binding and styling. Basically, my object has a property called "IsNodeInEditMode", and I have a RadTreeViewItem style that sets this property based on the object it's bound to:

        <Style TargetType="{x:Type telerik:RadTreeViewItem}"
            <Setter Property="IsExpanded" Value="{Binding IsNodeExpanded, Mode=TwoWay}" /> 
            <Setter Property="IsInEditMode" Value="{Binding IsNodeInEditMode, Mode=TwoWay}" /> 
        </Style> 

So, as soon as I insert the item, I also set its "IsNodeInEditMode" property to true, which effectively makes the tree item go to edit mode, however, when I change the name of the newly created item, and press enter, it changes back to the original name, and not what I set after creating it, you can see that in this video:


Can you think of something that might be resetting the name? I debbuged this, and checked the call stack on the Name property Set accessor, but I can't get to the code that makes this change since it's external.

Let me know. Thanks!

5 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 04 Jan 2010, 08:54 PM
Hi Lauren Nickerson,

Is the new name propagated correctly to the business object? How you update the business object with the new value?

Greetings,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Anthony
Top achievements
Rank 1
answered on 26 Aug 2013, 09:00 PM
I am having this same problem!  Has anyone found a solution.  It seems like a bug.
0
Pavel R. Pavlov
Telerik team
answered on 29 Aug 2013, 02:48 PM
Hi Anthony,

I tried to reproduce the reported behavior with our latest official release on our side and it seems that the code works as expected. Can you please take a look at the attached project and see if I missed something.

It will be great if you can change the code so that the issue can be reproduced in this project and send it over. By dong so I will be able to further investigate the reasons behind the reported behavior.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Scott
Top achievements
Rank 1
answered on 20 Feb 2014, 02:12 AM
The attached project doesn't seem to have any way to add nodes, nor any mechanism by which they would be added in edit mode. Does it?  That was the question, as I read it (and it is my issue now, as well.)
0
Pavel R. Pavlov
Telerik team
answered on 24 Feb 2014, 02:52 PM
Hello Scott,

You are right that in the previously attached project there is no way to add items in edit mode. Please note that that project demonstrates how your business object should implement the INotifyPropertyChanged interface and how the IsInEditMode property should be bound.

In the currently attached project, I implemented simple logic for adding new items in edit mode. You should create a DataTemplate that will be used when the item is in edit mode and bind the header of the item in TwoWay mode.
Also, that DataTemplate should be set as ItemEditTemplate of the RadTreeView control.

Please take a look at the attached project and let me know if you have any further questions.

Regards,
Pavel R. Pavlov
Telerik
Tags
TreeView
Asked by
Lauren Nickerson
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Anthony
Top achievements
Rank 1
Pavel R. Pavlov
Telerik team
Scott
Top achievements
Rank 1
Share this question
or