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

Open RadWindow from Context Menu

3 Answers 92 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 25 Nov 2008, 04:58 AM

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

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Nov 2008, 01:23 PM
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
0
Jon
Top achievements
Rank 1
answered on 25 Nov 2008, 02:32 PM
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
0
Veselin Vasilev
Telerik team
answered on 26 Nov 2008, 09:10 AM
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.
Tags
TreeView
Asked by
Jon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or