|
Rank: Newbie Groups: Member
Joined: 7/13/2009 Posts: 3
|
Hi,
How to maintain the second level of an expanded menu, when i usded databind
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, I assume you are using SlideMenu. The regular drop down menu does not maintain sub menu expanded status (there is no need to). SlideMenu automatically maintain expanded status unless you explicitly wipe the status information out --- typically through data binding. For example the following code will rebuild the slide menu every time thus wipe out the status information:
Code: C#
protected void Page_Load(object sender, EventArgs e)
{
SlideMenu1.DataSource = some_object;
SlideMenu1.DataBind();
}
In order to keep the status information, you should only populate the menu on intial page load:
Code: C#
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
SlideMenu1.DataSource = some_object;
SlideMenu1.DataBind();
}
}
If you use a master page together and NavigateUrl instead of post back, then its a different scenario. In that case you will need to set the slide menu's SaveStateCrossPages to true or set the slide menu's AutoSelectSource to "NavigateUr" and AutoSelectTarget to "Path" or "Item", Hope this helps. Thanks
|
|
Rank: Newbie Groups: Member
Joined: 7/23/2009 Posts: 5
|
Hi,
I also have this question. I have one menu with 3 levels. I wanted that the first and the second levels stayed always fixed and the 3rd appeared on mouse over. I am also doing databind.
Tk in advance
João Araújo
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Please see here for a working example of such a scenaro: http://demo.essentialobjects.com/Default.aspx?path=Menu\menu_programming\_i2\red_tabs2You can check the full sample source code to see how it works. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 7/13/2009 Posts: 3
|
Hi, I have one menu with 3 levels. I wanted that the first and the second levels stayed always fixed and the 3rd appeared on mouse over. I tried to use the red tab, but the menu does not work DataBinding.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Please see this post for detailed sample code on how to do this: http://www.essentialobjects.com/forum/postst3536_Web-Menu-Submenu-goes-out-of-the-controol.aspxThe basic idea is you will need to DataBind to the main menu, then use code to copy sub menus into the child menus. Thanks!
|
|