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

Context Menu failed to fire after clearing and rebuilding tree

3 Answers 49 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 10 Nov 2008, 11:54 PM
I have a tree that is dynamically built on page load along with context menus. Initially the context menus fires the ContextMenuItemClick(on server side) event successfully. I then clear the tree RadTreeView.Nodes.Clear() and then rebuild the tree including the root node and the context menus. The tree and the context menus load and display, however when I click on a context menu the ContextMenuItemClick event does not fire. Any suggestions? Thanks

3 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 11 Nov 2008, 11:44 AM
Hi John,

Do you set the same ID to the RadTreeView instance when it is rebuilt? You should set the same ID before adding the tree view to the parent control's Controls collection.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
John
Top achievements
Rank 1
answered on 11 Nov 2008, 01:11 PM
Thank you Erjan for responding.

I do not dynamically create the tree just the population of the tree so the tree id doesn't change.  I rebuild the tree after the context click the same way I did when the page is initially rendered. When I don't clear() the nodes. The tree rebuilds duplicating the population of the tree except for one difference due to the client's(move, delete) request via the context menu click. Even without calling the clear method I am unable to get any event firing for the context menu, although they will display after the ContextMenuItemClick event.
0
Erjan Gavalji
Telerik team
answered on 12 Nov 2008, 11:12 AM
Hi John,

I tried to replicate the scenario, but was not able to. Please, find attached the page I used. Can you check what am I missing?

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
John
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
John
Top achievements
Rank 1
Share this question
or