Hello Samantha,
You can try out the following code to achieve the required scenario. You can check for the text of the item and then make modifications as required.
cs:
protected void RadMenu1_PreRender(object sender, EventArgs e) |
{ |
//One root menu item with a different background color |
RadMenu1.Items[0].BackColor = System.Drawing.Color.Violet; |
|
//One root menu item as an image |
foreach (RadMenuItem item in RadMenu1.Items) |
{ |
if (item.Text == "Menu1") |
{ |
item.Controls.Clear(); |
Image img = new Image(); |
img.ID = "Image1"; |
img.ImageUrl = "~/images/Image1.gif"; |
item.Controls.Add(img); |
} |
|
|
//One root menu item's children to all be prefixed with an image |
if (item.Text == "Menu2") |
{ |
foreach(RadMenuItem subitem in item.Items) |
{ |
subitem.ImageUrl = "~/images/Image2.gif"; |
} |
} |
} |
} |
Thanks
Princy.