in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

NavBar and Hover

Last post 9/11/2008 12:03 PM by Eric_1. 0 replies.
Page 1 of 1 (1 items)
Sort Posts:
Previous Next
  • 9/11/2008 12:03 PM

    • Eric_1
    • Not Ranked
    • Joined on 9/11/2008
    • Posts 3

    NavBar and Hover

    I have converted a NavBar with hardcoded groups and menu items to one with the datasource pointed to an XML file. With the XML controlled NavBar I am using the GroupHeaderTemplate and ItemTemplate. This is the code I am using (based on an example found here):

    <GroupHeaderTemplate>
         <%# !string.IsNullOrEmpty(Container.Group.Name) ? Container.Group.Name : Container.Group.Text %>
    </GroupHeaderTemplate>

    <ItemTemplate>
        <a href="<%# Container.Item.NavigateUrl %>">
            <%# Container.Item.Text %>
        </a>
    </ItemTemplate>

    <ItemStyle CSSClass="dxnbItem" BackColor="White" />
    <DisabledStyle BackColor="White" />
    <GroupContentStyle BackColor="White" />

    Now the problem.  This does not generate the same code as the hardcoded version.  The hardcoded version puts class="dxnbItem" and an id in the table cell that surrounds the link, while the datasource version does not. Then javascript is used to add a hover class to the table cells using this function aspxAddHoverItems.

    The hardcoded version produces this:
    <td id="ctl00_LoginView1_ASPxNavBar1_I0i0_T" class="dxnbItem" style="background-color:White;width:100%;cursor:pointer;"><a href="schedule/workboard.aspx">Workboard</a></td>

    While the datasource version produces this:
    <td><a href="schedule/workboard.aspx">Workboard</a></td>

     

    How do I get a value for the id and the class added to the table cell?

    Filed under: , ,
Page 1 of 1 (1 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED