Open RadWindow from Context Menu

4 posts, 0 answers
  1. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 24 Nov 2008 Link to this post


    Dear Telerik,

    My tree has a context menu and one item is "Delete this item" The code behind for this event works - but I am trying to open up a modal RadConfirm window when this is clicked before actually deleting.

    I have tried some clientevents for the RadTreeViewContextMenu but cannot get it to work yet, if you can help please?

    Cheers,
    Jon
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 25 Nov 2008 Link to this post

    Hi Jon,

    Try the following approach in the OnClientContextMenuItemClicking event and see if it helps.

    ASPX:
                         <ContextMenus> 
                         <telerik:RadTreeViewContextMenu > 
                          <Items> 
                            <telerik:RadMenuItem Text="Delete"></telerik:RadMenuItem> 
                            <telerik:RadMenuItem Text="Edit"></telerik:RadMenuItem> 
                          </Items> 
                         </telerik:RadTreeViewContextMenu> 
                        </ContextMenus> 


    <telerik:RadWindowManager ID="RadWindowManager1"  runat="server"
            </telerik:RadWindowManager> 

    JS:
    <script type="text/javascript" > 
     
    function OnClientContextMenuItemClicking(sender, eventArgs) 
    var item = eventArgs.get_menuItem(); 
      if (item.get_text() == "Delete") 
      {        
          radconfirm("Are you sure you want to delete the node");
      } 
    <script/> 


    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 25 Nov 2008 Link to this post

    Hi Princy,

    Thanks for the reply.

    I can't get it to work, the page posts back even before you get a chance to click OK or cancel.

    I found this 

    http://www.telerik.com/community/forums/aspnet-ajax/treeview/onclientcontextmenuitemclicked-and-return-confirm.aspx

    which maybe means it can't be done ??

    Hope so but thanks again,

    Jon
  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 26 Nov 2008 Link to this post

    Hi jon byron,

    Please check this KB article: Using radprompt and radconfirm with Telerik navigational controls

    I hope this helps.

    All the best,
    Veselin Vasilev
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top