Home - Forums-.NET - FlyTreeView (ASP.NET) - ContextMenu

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

ContextMenu
Link Posted: 27-Jun-2008 04:52
Is there any way to place an image in the space to the left of text on a context menu? I am able to add an image right before the text, but the space on the left looks odd.
Link Posted: 27-Jun-2008 07:10
There's a way, but it's rather a hack than a feature.
For exmaple, for built-in Office2003 demo, I've added style (classes figured out from FireBug):
        
        .nrf0221-3, .nrf0221-1, .nrf0221-4
        {
            background: url(images/magnify-clip.png) no-repeat center left;
        }
        

This overrides rendered styles used by context menu by adding images.
Another option, if you just have source code of the control. In this case you can simply modify rendering function the way you need.
Link Posted: 02-Jul-2008 11:02
Does same class name get rendered every time?

I need to set a different image for each item.
This is working out well with the exception of the mouse over. What is the style for that so I can correct the image?
.nrf59050123-1 img { position: absolute; left: 3px;}
Link Posted: 02-Jul-2008 20:54
Yes, this is generated for all items.

I think, another option is to use image with negative left-margin in Text property of MenuItem.

For example, for Office2003 demo, I changed one of menu items to the following:
[/b]Expand" Javascript="ExpandNode(item, argument);" CommandName="Expand" />