I have a form which contains TreeView control. I need to convert it to RadTreeView. So I replaced TreeView control with RadTreeView and TreeNode with RadTreeNode in the code. I found that the events in both are different, so tried to replace the events with similar events in RadTree.
Following are the events that I have replaced in my code :
1.
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterExpand
Replaced by -
Private Sub TreeView1_AfterExpand(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.NodeExpandedChanged
2.
Private Sub TreeView1_AfterCollapse(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterCollapse
Replaced by -
Private Sub TreeView1_AfterCollapse(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.NodeExpandedChanged
and included Expanded flag to check if it is expand or collapse.
Here, I noticed unwanted firing of this replaced event when compared to the old event, but I handled it using the Expanded flag.
3.
Private Sub tvMain_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles tvMain.AfterSelect
Replaced by -
Private Sub tvMain_AfterSelect(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.RadTreeViewEventArgs) Handles tvMain.SelectedNodesChanged
This event gets fired twice while clicking on a node.
My main issues are,