I hope I can describe this clearly:
How can I dynamically set a different look (i.e. css) for each menu item, if pulled from a datasource.
I think it might help to show you some of my code (obviously I can change, add, delete whatever I need here).
Here is the XML file (ModTransformXSLTFile.xml) I'm pulling from: I put an ItemID here thinking I could assign a different style based on that ItemID, which you'll notice from my next example.
Code: XML
<MenuItems>
<MenuItem title="myExecution" description="" url="" ItemID="_Custom" Image_Url="Images/Menu/my_execution.gif" Image_Mode="ImageOnly" Norm_CSS="padding-left: 16px; text-align: left;" />
<MenuItem title="Restaurant Data" description="Daily Sales" ItemID="_Normal" url="~/mydata_dailysales.aspx" />
<MenuItem title="Accounting" description="Accounting Home" ItemID="_Normal" url="~/myacct_home.aspx" />
<MenuItem title="Store Contacts" description="Contacts Home" ItemID="_Normal" url="~/mycontacts_home.aspx" />
<MenuItem title="myPeople" description="" ItemID="_Custom" url="" Image_Url="Images/Menu/my_people.gif" Image_Mode="ImageOnly" Norm_CSS="padding-left: 0px; text-align: left;" />
<MenuItem title="HR Home" description="HR Home" ItemID="_Normal" url="~/myhr_home.aspx" />
<MenuItem title="My Forums" description="My Forums Home" ItemID="_Normal" url="~/myforum_home.aspx" />
<MenuItem title="The Rock" description="The Rock Home" ItemID="_Normal" url="~/therock_home.aspx" />
<MenuItem title="All American" description="All American Home" ItemID="_Normal" url="~/allamerican_home.aspx" />
</MenuItems>
Here is my .aspx page with the menu:
Code: HTML/ASPX
<eo:Menu ID="Menu2" runat="server" DataSourceID="XmlDataSource2" Width="184">
<TopGroup Style-CssClass="topGroup" Style-CssText="padding: 10px 0px 0px 0px; padding-left: 2px"
Orientation="Vertical">
<Bindings>
<eo:DataBinding Property="ItemID" DataField="@ItemID"></eo:DataBinding>
<eo:DataBinding Property="NormalStyle_CssText" DataField="@Norm_CSS"></eo:DataBinding>
<eo:DataBinding Property="Image-Url" DataField="@Image_Url"></eo:DataBinding>
<eo:DataBinding Property="Image-Mode" DataField="@Image_Mode"></eo:DataBinding>
</Bindings>
</TopGroup>
<LookItems>
<eo:MenuItem ItemID="_TopGroup">
<SubMenu Style-CssClass="subMenu">
</SubMenu>
</eo:MenuItem>
<eo:MenuItem Height="18" HoverStyle-CssText="color:black;" ItemID="_Normal" NormalStyle-CssText="color:white;"
Image-Url="Images/Menu/item_bg.gif" Image-Mode="TextBackground" Image-BackgroundRepeat="None">
</eo:MenuItem>
</LookItems>
</eo:Menu>
<asp:XmlDataSource ID="XmlDataSource2" runat="server" XPath="MenuItems/MenuItem"
DataFile="~/ModTransformXSLTFile.xml"></asp:XmlDataSource>
As You'll notice in this
link, you guys were able to hard code this menu, and it looks great. However, what I need is this done dynamically. I've gotten close but there are still some issues, mainly with my lack of understanding of this product.
From the .aspx page above, if I take this part out, I'm able to see my menu, but without the images with the lines. I've poured over the help documentation looking for how to solve this. I thought it had to do with the ItemID property. My thought is, I can assign the below code a particular itemID which I would set in the xml. I'm finding this is not the case.
Code: HTML/ASPX
<eo:MenuItem Height="18" HoverStyle-CssText="color:black;" ItemID="_Normal" NormalStyle-CssText="color:white;"
Image-Url="Images/Menu/item_bg.gif" Image-Mode="TextBackground" Image-BackgroundRepeat="None">
</eo:MenuItem>
Your help would be much appreciated, as this is the only real thing holding us back from purchasing the product.
Thank you in advance!