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

RadMenuItem

4 Answers 155 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Samee Mir
Top achievements
Rank 1
Samee Mir asked on 19 Jan 2010, 01:08 PM

hi

Telerik.Web.UI.

 

RadMenuItem item = new Telerik.Web.UI.RadMenuItem("New Menu", "~/LlbTest.aspx");
i want to open a popup window at the place of url can you please tell me how to do this.
regards
Samee Javaid

 

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Jan 2010, 01:30 PM
Hi Samee,

You can open the radwindow from client code in the OnClientItemCliking event of menu. And cancel the click event to prevent the page to redirect according to Navigateurl set for the item.

JavaScript:
 
<script type="text/javascript"
    function OnClientItemClicking(sender, args) { 
        var url = args.get_item().get_navigateUrl(); 
        var ownd = radopen(url); 
        args.set_cancel(true); // Cancel the event 
    } 
</script> 

-Shinu.
0
Samee Mir
Top achievements
Rank 1
answered on 20 Jan 2010, 06:26 AM
hi,
thnx shinu ...
there is a problem, i m using radfileExplorer and have to use its radGridContextMenu I cant use new radMenu
here is my code kindly check it

Telerik.Web.UI.

 

RadMenuItem item = new Telerik.Web.UI.RadMenuItem("New Menu");

 

RadFileExplorer1.GridContextMenu.Items.Add(item);

so is there any way i can use java script with GridContextMenu

regards,
Samee Javaid

0
Fiko
Telerik team
answered on 22 Jan 2010, 08:48 AM
Hi Samee,

You can add items attach handler to the GridContextMenu object of RadFileExplorer by using this approach:
protected void Page_Load(object sender, EventArgs e)
{
    RadMenuItem menuItem = new RadMenuItem("Open telerik.com", "http://www.telerik.com");
    RadFileExplorer1.GridContextMenu.Items.Add(menuItem);
    RadFileExplorer1.GridContextMenu.OnClientItemClicking = "OnGridContextMenuItemClicking";
}

For your convenience I have placed an example implementation of the OnGridContextMenuItemClicking handler:

<script type="text/javascript">
    function OnGridContextMenuItemClicking(oContextMenu, args)
    {
        // Whether a new window to be opened or not
        var isNewWndowRequired = true;
        if (isNewWndowRequired)
        {
            args.set_cancel(true);
            oContextMenu.hide();
            var menuItem = args.get_item();
            var navigateUrl = menuItem.get_navigateUrl();
            radopen(navigateUrl, null);
        }
        else
        {
            // Open the www.telerik.com in the same page;
        }
    }
</script>


I hope this helps.

All the best,
Fiko
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.
0
Samee Mir
Top achievements
Rank 1
answered on 22 Jan 2010, 10:58 AM
thanks..it works.:)    
Tags
FileExplorer
Asked by
Samee Mir
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Samee Mir
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or