We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Root Menu Item and NavigateUrl

Thread ID:

Created:

Updated:

Platform:

Replies:

50162 Oct 6,2006 05:14 PM Dec 5,2006 10:38 AM ASP.NET Web Forms (Classic) 11
loading
Tags: Tools
do i have to
Asked On October 6, 2006 05:14 PM

I am trying to get the root menu items (i.e. Menu items like File, Edit, etc.) to support the navigateurl property. I am setting the navigateurl property, but the control does nothing when I click on it. Is there something special that I need to do?

Bhuvana [Syncfusion]
Replied On October 9, 2006 06:15 AM

Hi Carlos,

Herewith attached is a sample that illustrates how to set navigate url for root items.

Menu Sample

Regards,
Bhuvana

do i have to
Replied On October 10, 2006 01:34 PM

Thanks, that should do it. It would be nice if the control exposed a property for this so that one doesn''t have to resort to having to write client-side code to attach to the onclick event and change the url in a future version.

Thanks again,

Carlos

do i have to
Replied On October 10, 2006 01:34 PM

Thanks, that should do it. It would be nice if the control exposed a property for this so that one doesn''t have to resort to having to write client-side code to attach to the onclick event and change the url in a future version.

Thanks again,

Carlos

do i have to
Replied On October 10, 2006 01:34 PM

Thanks, that should do it. It would be nice if the control exposed a property for this so that one doesn''t have to resort to having to write client-side code to attach to the onclick event and change the url in a future version.

Thanks again,

Carlos

do i have to
Replied On October 10, 2006 01:34 PM

Thanks, that should do it. It would be nice if the control exposed a property for this so that one doesn''t have to resort to having to write client-side code to attach to the onclick event and change the url in a future version.

Thanks again,

Carlos

do i have to
Replied On October 10, 2006 01:34 PM

Thanks, that should do it. It would be nice if the control exposed a property for this so that one doesn''t have to resort to having to write client-side code to attach to the onclick event and change the url in a future version.

Thanks again,

Carlos

Administrator [Syncfusion]
Replied On October 10, 2006 05:44 PM

Hi Bhuvana,

How do you recommend handling the scenario where the NavigateUrl for the MenuItem is dynamic? In your sample, you''ve hardcoded the string in the javascript; however, our url will depend on the environment the application is currently deployed at, so we can''t hardcode the url.

Thanks,

Carlos

Bhuvana [Syncfusion]
Replied On October 11, 2006 03:51 AM

Hi Carlos,

We can dynamically assign the NavigateUrl for the root menu items by passing as paramater to the client. Please refer to the attached sample.

Menu Sample

Regards,
Bhuvana

do i have to
Replied On October 11, 2006 06:58 AM

Hi Bhuvana,

Thanks for the sample; however, I don''t think it''ll work in our case. We have more than one root item. In your sample, there is only one, Product, and since the client side event handler is a property of the Menu, I can only provide one Url.

You have this in the sample (shortened).

Syncfusion.Web.UI.WebControls.Tools.Menu menu1 = new Syncfusion.Web.UI.WebControls.Tools.Menu();
menu1.ID = "menu1";
menu1.ClientSideOnItemMouseOver = "OnMenuMouseOver(this,''Default.aspx'')";

MenuItem product = new MenuItem();
product.Text = "Product";
product.ID = "Product";
menu1.Items.Add(product);

MenuItem grid = new MenuItem();
grid.Text = "Essential Grid";

product.Items.Add(grid);

What I need is something like this...

Syncfusion.Web.UI.WebControls.Tools.Menu menu1 = new Syncfusion.Web.UI.WebControls.Tools.Menu();
menu1.ID = "menu1";
// Because the event handler is set here
// I can only provide one url. In your sample
// It is Default.aspx; however, what if you
// have multiple root items?
menu1.ClientSideOnItemMouseOver = "OnMenuMouseOver(this,''Default.aspx'')";

MenuItem product = new MenuItem();
product.Text = "Product";
product.ID = "Product";
menu1.Items.Add(product);

MenuItem grid = new MenuItem();
grid.Text = "Essential Grid";

product.Items.Add(grid);

// Here''s my second root item. How do I provide
// a url for this guy?
MenuItem support = new MenuItem();
product.Text = "Support";
product.ID = "Support";
menu1.Items.Add(support);

MenuItem anotherGrid = new MenuItem();
anotherGrid.Text = "Essential Grid";

product.Items.Add(anotherGrid);

....

One thought is that I could do this:

menu1.ClientSideOnItemMouseOver = "OnMenuMouseOver(this,''Default.aspx'', ''Support.aspx'')";

But we have several root items and this is very brittel since it leads our client side script to be something like:

var bMouseClickAttached = false;
var bMouse2ClickAttached = false;

function OnMenuMouseOver( oData, url , url2 ) {
if (oData.ID == "Product" && !bMouseClickAttached) {
oData.Element.onclick=function(){ OnClick(url)};
bMouseClickAttached = true;
}

if (oData.ID == "Support" && !bMouse2ClickAttached) {
oData.Element.onclick=function(){ OnClick(url2)};
bMouseClickAttached = true;
}

// So on and so on for each root menu item...
}

This approach looks like it will be a maintenance nightmare for us. Is there a cleaner approach?

Thanks,

Carlos

Bhuvana [Syncfusion]
Replied On October 11, 2006 09:12 AM

Hi Carlos,

This has been added as a feature request and I will update you once this is implemented.

You can also keep track of the progress here.
http://www.syncfusion.com/support/features/tools/Default.aspx?ToDo=view&questId=1282

Thanks for your co-operation.

Regards,
Bhuvana

Administrator [Syncfusion]
Replied On December 5, 2006 10:38 AM

Hi Carlos,

Navigate URL property for Menu Item has been implemented in our lattest version(v4.4).This version includes advanced features and fixes.

Please download it in the following location,

http://files2.syncfusion.com/Installs/v4.4.0.51/syncfusionessentialstudiosetup.exe

Thank you for using syncfusion products.

Regards,
SureshSekaran.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;