Welcome Guest Search | Active Topics | Sign In | Register

Roundcorner Menu and Loading from Access Database Options
IanPennick
Posted: Monday, October 13, 2008 9:07:34 AM
Rank: Newbie
Groups: Member

Joined: 6/30/2007
Posts: 5
Hello Support

I've written some code to load one of the Menu examples from an access Database. I wanted to use the RoundCorners Menu template but think that this isnt possible as a databound object. It loses its shape and its seperators etc when loaded with the Dataset.

Just in case I am being silly can you just let me know if there is a way to programmatically fill this type, and retain its structure and shape - If so some simple Visual Studio Examples would be a real aid, especially to us novice programmers.

Many Thanks

Ian
eo_support
Posted: Monday, October 13, 2008 9:44:11 AM
Rank: Administration
Groups: Administration

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

You should be able to use data binding with a few extra steps.

What's special for RoudnConerns menu is the "corners" are also menu items. Since data binding always wipe out everything and rebuild from the database, it would also wipe out these "corners". The solution is for you to populate from the database first, then manually add those "corners" by code.

To implement this, you would first follow steps outlined in the document to create a menu without corners. Then use something like this to add the corner back:

Code: C#
//Populate the menu from the database
Menu1.DataSource = your data source;
Menu1.DataBind();

EO.Web.MenuItem leftCorner = new EO.Web.MenuItem();

//set leftCorner styles....
.....

//Insert leftCorner as the first menu item before all
Menu1.Items.Insert(0, leftCorner);


Note you will definitely want to go over the following documentation topics in order to understand how to customize menu item styles (thus understand how the corners are created):

EO.Web.Menu -> Using EO.Web Menu -> Navigation Items and Groups
EO.Web.Menu -> Using EO.Web Menu -> Look, Skin and Theme
EO.Web.Menu -> Using EO.Web Menu -> Style and Appearance

You will also need to go over this topic to understand how to populate menu from a datasource if you are not already familiar with this part:

EO.Web.Menu -> Using EO.Web Menu -> Data Binding

Hope this helps.

Thanks

IanPennick
Posted: Tuesday, October 14, 2008 3:15:21 AM
Rank: Newbie
Groups: Member

Joined: 6/30/2007
Posts: 5
Thanks for the Reply,

I'm really sorry to ask for a bit more detail, but I am floundering and would really appreciate the help.

I am working in Visual Basic Code... so I am assuming the Line that you sent for the C# version of
EO.Web.MenuItem leftCorner = new EO.Web.MenuItem();

should be the following for VB
Dim LeftCorner = New EO.Web.MenuItem()

I've read through the notes you suggested and I can understand what you mean but am sorry but just cant seem to apply the knowlegde into the code.. Is there any chance that you could give me some actual cosing for the //set leftCorner styles....
.....
I'm guessing that this is

Leftcorner. etc etc.. / But I cant find any coded examples of the properties - ( Sorry I am a bit of a novice)

If there is any sample code or a sample Visual basic project that illustrates the techniques, It would be really great.
many Thanks for your help

Ian
eo_support
Posted: Tuesday, October 14, 2008 6:25:54 AM
Rank: Administration
Groups: Administration

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

We could provide you a full sample for that, but first of all you will want to go over the existing sample first. Since there are thousands of ways to use our product, there is no way for us to produce a sample that covers every scenario. For example, even if we were to produce a sample demonstrating how to create the round corner menu from the database, the database structure in our sample might still be different than yours. In that case if you do not understand how that part works, you still will not be able to adapt our sample to fit your needs.

The two most important resources for our product are the sample project and documentation. Both can be found at Start -> All Programs -> EO.Web Controls 2008 -> EO.Web Controls for ASP.NET 1.1/2.0. You will be able to find all source code for the live demo project as well as full documentation in .chm format.

Once you get some basic idea of how the menu works, you would simply find the corresponding properties and set it. For example:

Code: Visual Basic.NET
leftCorner.NormalStyle.BackColor = "red"


Some more sample code here:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.ElementStyle.html

The key is, you need to be able to read the reference section of the documentation to find out what properties are available for what purpose. For example, the reference would tell you a MenuItem object has a NormalStyle property that can be used to set style when the item is in normal state.

Thanks!


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.