Context Menu failed to fire after clearing and rebuilding tree

4 posts, 0 answers
  1. John
    John avatar
    5 posts
    Member since:
    Oct 2008

    Posted 10 Nov 2008 Link to this post

    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
  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 11 Nov 2008 Link to this post

    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.
  3. John
    John avatar
    5 posts
    Member since:
    Oct 2008

    Posted 11 Nov 2008 Link to this post

    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.
  4. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 12 Nov 2008 Link to this post

    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.
Back to Top