Insert items in edit mode problem

6 posts, 0 answers
  1. Lauren Nickerson
    Lauren Nickerson avatar
    52 posts
    Member since:
    Jul 2009

    Posted 29 Dec 2009 Link to this post

    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!

  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 04 Jan 2010 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anthony
    Anthony avatar
    2 posts
    Member since:
    Aug 2013

    Posted 26 Aug 2013 Link to this post

    I am having this same problem!  Has anyone found a solution.  It seems like a bug.
  5. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 29 Aug 2013 Link to this post

    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 >>
  6. Scott
    Scott avatar
    3 posts
    Member since:
    Sep 2012

    Posted 19 Feb 2014 in reply to Pavel R. Pavlov Link to this post

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

    Posted 24 Feb 2014 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready