On my NavBar I have Itemlooks defined to display the same for hovering and Active or Expanded items on the second level. Although the hover style works perfectly, the Active and Expanded styles, although the same as hover do not work.
Is there a reason for it?
The first level styles apply successfully but not all of the second level styles.
The styles that do not apply are: ActiveCssClass="Level2ItemHover" ExpandedCssClass="Level2ItemHover"
I have a navbar with two Itemlooks defined as follows:
<componentart:navbar id="SideNav" runat="server" ExpandSinglePath="True" DefaultTarget="mainFrame" CssClass="NavBar" ClientTarget="Auto" ClientObjectId="NavBar1" Width="100%" PreRenderAllLevels="True"> <ItemLooks> <componentart:ItemLook HoverCssClass="TopItemHover" ActiveCssClass="TopItemActive" ExpandedCssClass="TopItemActive" LookId="TopItemLook" CssClass="TopItem"></componentart:ItemLook> <componentart:ItemLook HoverCssClass="Level2ItemHover" ActiveCssClass="Level2ItemHover" ExpandedCssClass="Level2ItemHover" LookId="Level2ItemLook" CssClass="Level2Item"></componentart:ItemLook> </ItemLooks> </componentart:navbar>
With VB code as follows
Private Sub Fillmenu(ByVal parentid As Integer) Dim dr() As DataRow = dsMenu.Tables(0).Select("NonMenuItem = False AND ParentID = " & parentid & " AND ProductId = " & Session("AdminMenu")) For i As Integer = 0 To dr.Length - 1 If Session("IsMaster") OrElse dsUserAccess.Tables(0).Select("UserID = " & Session("UserID") & " AND MenuID = " & dr(i)("MenuId")).Length > 0 Then Dim nbi As New ComponentArt.Web.UI.NavBarItem nbi.TextWrap = True If parentid = 0 Then nbi.LookId = "TopItemLook" nbi.CssClass = "TopItem" nbi.Look.ActiveCssClass = "TopItemActive" nbi.Look.ExpandedCssClass = "TopItemActive" nbi.Look.HoverCssClass = "TopItemHover" 'nbi.DefaultSubGroupCssClass = "Level2Item" 'nbi.DefaultSubItemChildSelectedLook.ActiveCssClass = "Level2ItemActive" 'nbi.DefaultSubItemChildSelectedLook.ExpandedCssClass = "Level2ItemActive" 'nbi.DefaultSubItemChildSelectedLook.HoverCssClass = "Level2ItemHover" Else nbi.LookId = "Level2ItemLook" End If nbi.Text = Translate(dr(i)("MenuDescription")) nbi.NavigateUrl = dr(i)("PageLink") FillMenu(dr(i)("MenuId"), nbi) SideNav.Items.Add(nbi) End If Next End Sub Private Sub Fillmenu(ByVal parentid As Integer, ByRef itm As ComponentArt.Web.UI.NavBarItem) Dim dr() As DataRow = dsMenu.Tables(0).Select("NonMenuItem = False AND ParentID = " & parentid & " AND ProductId = " & Session("AdminMenu")) For i As Integer = 0 To dr.Length - 1 If Session("IsMaster") OrElse dsUserAccess.Tables(0).Select("UserID = " & Session("UserID") & " AND MenuID = " & dr(i)("MenuId")).Length > 0 Then Dim nbi As New ComponentArt.Web.UI.NavBarItem nbi.TextWrap = True If parentid = 0 Then nbi.LookId = "TopItemLook" 'nbi.CssClass = "TopItem" 'nbi.Look.ActiveCssClass = "TopItemActive" 'nbi.Look.ExpandedCssClass = "TopItemActive" 'nbi.Look.HoverCssClass = "TopItemHover" 'nbi.DefaultSubGroupCssClass = "Level2Item" 'nbi.DefaultSubItemChildSelectedLook.ActiveCssClass = "Level2ItemActive" 'nbi.DefaultSubItemChildSelectedLook.ExpandedCssClass = "Level2ItemActive" 'nbi.DefaultSubItemChildSelectedLook.HoverCssClass = "Level2ItemHover" Else nbi.LookId = "Level2ItemLook" 'nbi.CssClass = "Level2Item" 'nbi.Look.ActiveCssClass = "Level2ItemActive" 'nbi.Look.ExpandedCssClass = "Level2ItemActive" 'nbi.Look.HoverCssClass = "Level2ItemHover" End If nbi.Text = Translate(dr(i)("MenuDescription")) nbi.NavigateUrl = dr(i)("PageLink") FillMenu(dr(i)("MenuId"), nbi) itm.Items.Add(nbi) End If Next End Sub