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. Image for the cookie policy date
close icon

How to dynamically add sub-menus to the main XPMenu?

Hi, We have Essential Suite 3.0.1. I''ve been unsuccessfully trying to dynamically add a top level menu item (with sub-items) to the main XPMenu and would appreciate some help. Here''s what I''ve tried so far: ParentBarItem customMenu = new ParentBarItem(); customMenu.CategoryIndex = 2; customMenu.Text = "Test"; customMenu.ID = "Test"; customMenu.Visible = true; // frameBarMgr - XPMenus.MainFrameBarManager frameBarMgr.Items.Add(customMenu); // menuBar - XPMenus.Bar menuBar.Items.Add(customMenu); My problem is that new top level item doesn''t show up at all. Any ideas why? Thanks in advance.

4 Replies

AD Administrator Syncfusion Team August 26, 2005 03:38 PM UTC

Hi Sergey, I have attached a sample that creates menus dynamically.Please refer to it and let me know if this meets your requirements.We appreciate your interest in Syncfusion products. Regards, Ebenezer.P DynamicMenus_3056.zip


MS Michael Scott June 14, 2006 08:50 PM UTC

What if the top level item is already there? For instance, Edit | View. I''ve got 3 items under Edit | View already, but I want to add a separator below those, then programatically add any number of pics after that separator. It may be 1, it may be 20. How would I do that, including the event handler for them? Michael >Hi Sergey, > >I have attached a sample that creates menus dynamically.Please refer to it and let me know if this meets your requirements.We appreciate your interest in Syncfusion products. > >Regards, >Ebenezer.P > > >DynamicMenus_3056.zip > >


J. J.Nagarajan Syncfusion Team June 15, 2006 04:10 PM UTC

Hi Michael, Yes,you can create a separator through programmatically using the following code this.parentBarItem2.BeginGroupAt(barItem7); I have attached a sample that demonstrate this completely.In this sample I have created 3 baritems already under Edit menu ,then programmatically added 3 baritems after a separator.Please refer to it and let me know if this meets your requirements.We appreciate your interest in Syncfusion products. Thank you, J.Nagaraj DynamicMenus.zip


J. J.Nagarajan Syncfusion Team June 15, 2006 04:14 PM UTC

Hi, Sorry for inconvenience caused.I have attached a wrong sample in the previous update.Here is the sample. F33764.zip

Loader.
Live Chat Icon For mobile
Up arrow icon