Problem of Editing a silverlight RadTreeViewItem

12 posts, 0 answers
  1. Guy
    Guy avatar
    46 posts
    Member since:
    Nov 2008

    Posted 11 Mar 2011 Link to this post

    Hi,
    I Have a problem with my application when I m trying to edit a radTreeViewItem. I use MVVM Pattern and I bind the radTreeViewItem's IsInEditMode with a boolean property of my business object. But sometimes the EditStart Event fires and a can Edit or sometimes the isinEditmode is set to true and EditStart event does not fire. In the latter case I lost the header and I can not edit.
    I tried also not using the IsInEditMode property by using directly the BeginEdit() method on the RadTreeViewItem but also in that case sometimes i can edit sometimes not. I saw also in the wpf forum other people who have faced the same problem and i tried all suggested solutions without success.

    Thank U for your help to overcome that problem
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 16 Mar 2011 Link to this post

    Hi Guy,

    Could you please send us a runnable sample showing the issue ?  This way we could investigate it in depth and provide you with a better suited solution or advice? Meanwhile you can examine this demo or this documentation article and check if you have missed something. You can also test your application with the dlls from Q1 2011 Beta or some of the latest internal builds and see if the problem is still reproducible. Thank you for your cooperation.

    All the best,
    Petar Mladenov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Guy
    Guy avatar
    46 posts
    Member since:
    Nov 2008

    Posted 29 Mar 2011 Link to this post

    Hi,
    Thanks u for your help.  I solve partially the problem by setting directely the IsInEditMode property of RadTreeViewItem instead using binding. But the problem i faced is when I add a new item using a contextMenu of the radtreeView. I use the itemPrepared Event to set the IsInEditMode but the EditStarted event does not fire.
    This the code I wrote for ItemPrepared Event:
    private void favRadTreeView_ItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
           {
               if (_OnCreating)
               {
                    e.PreparedItem.IsInEditMode = true;
                   //e.PreparedItem.BeginEdit();
               }
           }

    But even when i use BeginEdit() method there is no EditStarted event fired.
    Another problem i saw, during the editing it's not to insert the space. The demo example here http://demos.telerik.com/silverlight/#TreeView/NodeEditing does not accept the space character when editing. Is there a way to include the space character when editing?

    Thanks for your help.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 Apr 2011 Link to this post

    Hi Guy,

    Could you please elaborate more on your scenario, a sample project will be highly appreciated? It is very possible that the contextmenu steals the focus that the RadTreeViewItem needs in order to get into Edit Mode. On the other hand, the issue with the space key in edit mode is known and the fix for it will be included in the following internal build next week and SP1 13 scheduled for 13 April.

    All the best,
    Petar Mladenov
    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
  6. Devon
    Devon avatar
    11 posts
    Member since:
    Jun 2008

    Posted 04 Aug 2011 Link to this post

    I am also having this same problem, I have a context menu and when I try to bind to the IsInEditMode property and then try to edit a node the header disappears.  So I tried the treeItem.BeginEdit() function in codebehind and it randomly works, when it stops working I cannot edit any nodes unless I reload the program.

    I have created a project that shows this bug,

    I will open a support ticket up for this:

    Chad

  7. Boardy
    Boardy avatar
    14 posts
    Member since:
    Mar 2010

    Posted 07 Sep 2011 Link to this post

    Same here. Treeview with context menu, but no binding at all. Though, when the PreviewExpanded event is fired, the child-nodes are retrieved from a service (asynchronously). Usually after expanding a couple of nodes, editing stops working. Observation/guess: It might start to go awry when the treeview is still in editing mode when the results of a request come in and new nodes are added.
  8. Hristo
    Admin
    Hristo avatar
    352 posts

    Posted 12 Sep 2011 Link to this post

    Hello,

    Currently we are aware of two cases in which the edit mode is not working correctly:
    1. The first case is when tree view item is put into edit mode and before the edit mode is completed another item is also put in edit mode. This case is generally achieved through code and calling the BeginEdit method. Usually the BeginEdit is called on a click of button placed inside the TreeViewItem template. This bug is already fixed and should not be occurring with the upcoming 2011 Q2 SP release dlls.
    2. The second issue is generally described as: "Edit mode does not starts when fast clicks are performed over tree items". Actually this issue is cause by the drag and drop manager and its functionality. We are still investigating the cause and will try fix it as soon as possible. However, a workaround by setting the IsDragDropEnabled property to true could be used for the time being we fix this.

    Hope this post is helpful for understanding and correctly determining which of the two cases you are having troubles with.

    Finally, if your scenario is different from the ones described above, I would be please if you share it with us and provide a test project. 

    Regards,
    Hristo
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

  9. Boardy
    Boardy avatar
    14 posts
    Member since:
    Mar 2010

    Posted 13 Sep 2011 Link to this post

    Thank you Hristo,

     Indeed I'm struggling with case 2. It seems by setting the following in the constructor:
    TheTreeView.IsDragDropEnabled = true;
    TheTreeView.IsDropPreviewLineEnabled = false;
    TheTreeView.IsDragTooltipEnabled = false;
    TheTreeView.PreviewDragEnded += new RadTreeViewDragEndedEventHandler(TheTreeView_PreviewDragEnded);
    TheTreeView.IsDragPreviewEnabled =
    false;
    with the event just being
    private void TheTreeView_PreviewDragEnded(object sender, RadTreeViewDragEndedEventArgs e)
    {
      e.Handled = true// This will cancel the drag operation.
    }
    everything looks as if drag and drop is disabled and editing nodes stays operational indeed.

    When only setting IsDragDropEnabled and then cancelling the drag and drop operation in the PreviewDragStarted() event is not enough to get rid of the problem.

    P.S. The IsDropPreviewLineEnabled property is not shown in the Properties Window (VS2010). But is suggested and can be entered in xaml directly.
  10. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 16 Sep 2011 Link to this post

    Hi Boardy,

     We agree that your workaround is better if you don't want to use the DragAndDrop feature. On the other hand, we logged a bug in our PITS(TreeView: The IsDropPreviewLineEnabled property is not shown in the Properties Window) and we also updated your telerik account points as a thanks for your cooperation.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  11. Vladislav
    Admin
    Vladislav avatar
    276 posts

    Posted 29 Feb 2012 Link to this post

    Hi guys,

    We want to inform you that this issue is fixed in our latest official 2012 Q1 release.
    It will be great if you can give it a try and let us know if it works for you.

    On a separate note, I'd like to let you know that there are 5 brand new controls that we included in this release:
    - Diagrams (Beta)
    - GanttView (CTP)
    - TimeLine
    - ListBox (Beta)
    - DataBar
    When you have time, you can give them a try as we will highly appreciate your feedback.


    Greetings,
    Vladislav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  12. Farheen
    Farheen avatar
    1 posts
    Member since:
    May 2013

    Posted 12 Feb 2015 in reply to Hristo Link to this post

    Hi,

    I am currently using the telerik controls for silverlight version 2011.2.712.1040.
    In this version, in RadTreeView i am facing the same issue as discussed in this post.
    Sometimes the Edit started event does not fire when i try to rename an item. It is not very consistent and i am not able to find out why this happens. 
    Kindly provide a solution for this issue as we are not planning to migrate the telerik version.

    Thanks
    Farheen
  13. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 13 Feb 2015 Link to this post

    Hello Fartheen,

    What logic do you need to perform on EditStarted ? Or the Item does not go into edit mode at all ?
    If you bind the IsInEditMode to boolean property from our ViewModels, you can use the setter or the property instead of the event.
    On a side note, we highly encourage you to upgrade because the version you use is almost 4 years ago and you may also hit other issues that are fixed in newer versions. Additionaly, you will be able to take advantage of all new features and new controls in our latest release compared to the release in 2011.

    Regards,
    Petar Mladenov
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner