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

Removing Nodes - LoadOnDemand

5 Answers 40 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Gallen
Top achievements
Rank 1
Paul Gallen asked on 21 May 2009, 09:11 AM
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

5 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 25 May 2009, 01:42 PM
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.
0
Paul Gallen
Top achievements
Rank 1
answered on 26 May 2009, 09:39 AM
I think you have forgot to attach the sample project.

0
Dimitrina
Telerik team
answered on 26 May 2009, 01:16 PM
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.
0
Paul Gallen
Top achievements
Rank 1
answered on 27 May 2009, 08:51 AM

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
0
Dimitrina
Telerik team
answered on 27 May 2009, 02:22 PM
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.
Tags
TreeView
Asked by
Paul Gallen
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Paul Gallen
Top achievements
Rank 1
Share this question
or