Hello everyone!
I've got the below RadSiteMap being coded from codebehind (VB). I want to add small icons to the left of each submenu's text however I do not know how. The ImageUrl property apparently does not exist for the RadSiteMap and I cannot think of another way to insert my icons.
Check the attached screenshot to see how my menu looks like and where would I want to add icons. I basically want to add them into the titles and then a different icon to each submenu as well.
Note: My RadMenu is being populated entirely from a database (all of it, parent and childs). If you wish to see the code for a better understanding, I can also leave that in the comments.
Thanks a lot!
Private Function CreateSiteMap(ByVal container As Control, ByVal Id As String) As RadSiteMap
Try
System.Diagnostics.Debug.WriteLine("id: " &Id)
Dim acd As New SiteWeb.AccesDonnees
'On créer le controle de type RadSiteMap
Dim SiteMap1 As New RadSiteMap
'On le configure comme souhaité
SiteMap1.ID = "SiteMapMenu"
SiteMap1.DataTextField = "Libelle"
SiteMap1.DataFieldID = "Identifiant"
SiteMap1.DataFieldParentID = "Parent"
SiteMap1.DataValueField = "Libelle"
SiteMap1.DataNavigateUrlField = "Lienpage"
'This sql receives all the submenus under the current Parent menu
SiteMap1.DataSource =
acd.RetournerDataReader("SELECT RTRIM(Identifiant) as Identifiant,RTrim(Libelle) As Libelle,RTrim(Parent) as Parent,RTRIM(Lienpage) as Lienpage,RTRIM(ParentGlobal) As ParentGlobal FROM lobdjetBDD WHERE NomUser = '" & hf_fonction.Value & "' AND (Parent = '" & Id & "' OR ParentGlobal = '" & Id & "' OR Identifiant = '" & Id & "') Order By Libelle, ChapitreParentGlobal, ChapitreParent,ChapitreEnfant", "EU_BREST")
SiteMap1.DataBind()
[.....] I removed this part of the code to make my post smaller on the forums.
container.Controls.Add(SiteMap1)
Return SiteMap1
Catch ex As Exception
Return Nothing
Exit Function
End Try
End Function