Server side event when creating new node via context menu

6 posts, 1 answers
  1. Greg
    Greg avatar
    17 posts
    Member since:
    Mar 2009

    Posted 09 Nov 2009 Link to this post

    I have a treeview and a context menu based on the examples on this website, with some added functionality.

    When right clicking on a node and adding a new node, the node is put into edit mode. If I change the name of the newly created node (I set a default value in code behind), the NodeEdit server side event fires, which is what I want.

    However, if I do not change the name, the server side event does not fire. This is likely by design. However, in the case where I am creating new nodes, I need that server event to fire anyway.

    Is there a way to do this?

    Greg
  2. Answer
    Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 12 Nov 2009 Link to this post

    Hi Greg,

    There is no good and clean method of doing this.
    If you wish to override some private methods of the treeview you might achieve that but it is not the recommended approach.

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Greg
    Greg avatar
    17 posts
    Member since:
    Mar 2009

    Posted 12 Nov 2009 Link to this post

    It would be nice to see this as a feature in a future release.

    Thanks.
  5. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 11 Jan 2013 Link to this post

    I have the same issues. So which is the recommended approach? This should be a rather common approach? It seems to work as I want in Outlook Web Access 2010 when adding a new folder to my mailbox.

    I don´t want to use plan client-side since I always rely on each node having a Value corresponding to the items database id. WHen using regular server side I guess I cannot set the node in edit mode from server side.
    Thanks

    Martin
  6. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 15 Jan 2013 Link to this post

    Hi Martin,

    I've prepared a small sample page using the RadTreeView ContextMenu demo as a reference, which has the desired functionality. The only change I made, other than stripping the page from the unneeded code, is the addition of the following two lines in the startNodeInEditMode method:
    js += "node._originalText = \"\";";
    js += "node._originalTextHtml = \"\";";

    You can find the page attached to this reply.
     

    Greetings,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  7. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 15 Jan 2013 Link to this post

    Many thanks!
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017