Welcome Guest Search | Active Topics | Sign In | Register

Menu not shown on the ToolBar DropDownMenu type button Options
Nir Ben David
Posted: Monday, November 21, 2011 9:23:44 AM
Rank: Newbie
Groups: Member

Joined: 11/21/2011
Posts: 2
Code: C#


Hi!

I'm trying to put DropDownMenu type button on the Toolbar. On the button I see the picture and the arrow, but the menu is not shown. What am I doing wrong?
ToolBar1 was draged & droped from the ToolBox.

protected void Page_Load(object sender, EventArgs e)
Code: C#

{
if (!IsPostBack)
{
EO.Web.ToolBarItem toolBarItem = new EO.Web.ToolBarItem();
toolBarItem = new EO.Web.ToolBarItem();
toolBarItem.Type = EO.Web.ToolBarItemType.DropDownMenu;
toolBarItem.ImageUrl = "00101007";

EO.Web.Menu menu = new EO.Web.Menu();
EO.Web.MenuItem menuItem = new EO.Web.MenuItem();
menuItem.Text = "Item 1";
menu.Items.Add(menuItem);

menuItem = new EO.Web.MenuItem();
menuItem.Text = "Item 2";
menu.Items.Add(menuItem);

menuItem = new EO.Web.MenuItem();
menuItem.Text = "Item 3";
menu.Items.Add(menuItem);

toolBarItem.DropDownMenuID = menu.ID;
ToolBar1.Items.Add(toolBarItem);

}
}

Thank you,
Jerzy
eo_support
Posted: Monday, November 21, 2011 9:35:51 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Please try to:

1. Explicitly give your Menu an ID. In your case, your Menu's ID is always null;

2. You must add your Menu into this page. For example, you can put a Panel in the page and then call Panel1.Controls.Add(menu) to add menu into that Panel;

3. Usually you should use a ContextMenu control instead of a Menu control. A ContextMenu control is not visible by default. If you use a Menu, once you complete step 2, the menu will be visible on your page;

Thanks!
Nir Ben David
Posted: Monday, November 21, 2011 9:48:51 AM
Rank: Newbie
Groups: Member

Joined: 11/21/2011
Posts: 2
Thank you very much. That was fast!
Jerzy


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.