Removing Nodes - LoadOnDemand

6 posts, 0 answers
  1. Paul Gallen
    Paul Gallen avatar
    156 posts
    Member since:
    Jun 2008

    Posted 21 May 2009 Link to this post

    Hi,

    Can you give me and example of removing nodes from your RadTreeView as the code snippet below generates an error, at line 
      
    Parent.Items.Remove(DirectCast(e.Source, TreeViewItem))   


     Private Sub trvListEvents_Edited(ByVal sender As ObjectByVal e As Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs) Handles trvListEvents.Edited  
            If e.OldText <> e.NewText Then 
                ActionMenuRequest(DirectCast(e.Source, RadTreeViewItem))  
            Else 
                Dim Parent As RadTreeViewItem = Me.CurrentTreeViewItem.Parent  
                Parent.Items.Remove(DirectCast(e.Source, TreeViewItem))  
            End If 
     
        End Sub 

    Requirements: After Editing a node, if it does not meet a certain criteria, then delete the node.

    Note: I am using the RadTreeView with LoadOnDemand

    Best

    P

  2. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 25 May 2009 Link to this post

    Hello Paul,

    Thank you for your feedback. It turned out that you hit a bug in the RadTreeView control. I scheduled it to be fixed for our next release and updated your Telerik points.

    For the time being, you can use a workaround which I demonstrated in the attached sample project. Please let me know if this would work for you.

    Greetings,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Paul Gallen
    Paul Gallen avatar
    156 posts
    Member since:
    Jun 2008

    Posted 26 May 2009 Link to this post

    I think you have forgot to attach the sample project.

  4. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 26 May 2009 Link to this post

    Hi Paul Gallen,

    Sorry, I forgot to attach the file in the previous email.Please accept my apologies and find attached the file to this thread.

    Sincerely yours,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Paul Gallen
    Paul Gallen avatar
    156 posts
    Member since:
    Jun 2008

    Posted 27 May 2009 Link to this post


    Thanks

    That seems to work fine. I presume you would code the same sort of thing when the user presses the delete key?


    Best

    P
  6. Dimitrina
    Admin
    Dimitrina avatar
    442 posts

    Posted 27 May 2009 Link to this post

    Hi Paul Gallen,

    Yes, you can use the same approach with the Delete key.

    Best wishes,
    Dimitrina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top