Last post Dec 29, 2006 03:52 PM by Classicsmiley
Jun 12, 2006 04:11 PM|bond|LINK
Jun 13, 2006 02:42 PM|Russ Helfand|LINK
If you're willing to do a little coding I can suggest a solution.
Take a look at line 100 of
http://www.asp.net/CSSAdapters/SrcViewer.aspx?inspect=~/App_Code/Adapters/TreeViewAdapter.cs. See where it is assigning a single class to the li tag? You could, instead, assign a pair of classes. The first class would still be either AspNet-Menu-WithChildren
or AspNet-Menu-Leaf (just like the present logic handles). But you would add a second class after either of those (separated by a space from the first class). It would be a new class that you would invent. I'd recommend that you create this new class name
heuristically by leveraging (and massaging) the MenuItem.ValuePath property since it uniquely identifies every menu item in the menu. Then, in your CSS you would define specific classes to match this new class.
Does any of that make sense to you? If not, write back!
Jun 19, 2006 10:35 PM|bond|LINK
Sep 21, 2006 01:57 AM|petero|LINK
Thanks - I've also found this a useful way to customize each menu item...
Adding into BuildItem in MenuAdapter.cs
if (item.Value != null && item.Value.Length > 0)
Dec 29, 2006 02:34 PM|Classicsmiley|LINK
Excellent! It's amazing what that one little addition can do for these adapters. I'm surprised that they didn't build this functionality in to begin with...
Dec 29, 2006 03:45 PM|Russ Helfand|LINK
I'll be "mining" these postings when putting together recommendations to Microsoft for what would have the most user-appeal in a future rev of the kit. I'll keep this posting in mind. It's pretty clear that lots of folks want to style their menu items
individually. That's a fair thing to want to put into a future rev. Maybe we'll do it in a way that allows you to specify which menus should have their individual items identified (by a class or ID) to facilitate individual item styling... but also allow
you to have menus that are trimmer (i.e., the markup isn't cluttered with these sorts of superfluous class/ID attributes on menus that don't need/want them).
Thanks for the input.
Dec 29, 2006 03:52 PM|Classicsmiley|LINK
Thanks! I agree, the ability to choose whether or not I want to specify individual item styling would be wonderful. Some projects need it, others don't...