Ticket Q572512
Visible to All Users

MVC Extensions Treeview is giving me a button instead of a normal node

created 11 years ago

I have the following code in a partial view.

C#
<div class="leftPanel"> @Html.DevExpress().TreeView(settings => { settings.Name = "LeftNavBar"; settings.EnableAnimation = true; settings.Width = System.Web.UI.WebControls.Unit.Percentage(100); }).BindToXML(HttpContext.Current.Server.MapPath("~/App_Data/SideMenu.xml"), "/menu/*").GetHtml() </div>

My xml is as follows.

XML
<?xml version="1.0" encoding="utf-8" ?> <menu> <group Text="Administration" ImageUrl="/Content/Images/FolderIcon.png"> <item Text="Role Management" NavigateUrl="/Account/ListRoles" /> </group> <group Text="Reporting" ImageUrl="/Content/Images/FolderIcon.png"> <item Text="List Reports" NavigateUrl="/Report/ListReports" /> </group> </menu>

If I use "/Report/ListReports" in the NavigateUrl I get a button for that node. If I put anything else, I get a standard format node. Any help would be appreciated.

Comments (1)

    Actually, I just realized this is the behavior when you are on the page that is listed in the menu. This is the control's way of highlighting that menu option. What is the best way to just highlight the text itself instead (aka just change the color on hover?)

    Answers approved by DevExpress Support

    created 11 years ago (modified 11 years ago)

    Hello Matt,
    You can use the following settings to implement the required task:

    CSS
    .dxtv-ndHov { background-image: none !important; }
    C#
    @Html.DevExpress().TreeView(settings => { settings.Name = "LeftNavBar"; settings.EnableAnimation = true; settings.Width = System.Web.UI.WebControls.Unit.Percentage(100); settings.Styles.Node.HoverStyle.BackColor = System.Drawing.Color.Transparent; settings.Styles.Node.Border.BorderColor = System.Drawing.Color.Transparent; settings.Styles.Node.HoverStyle.ForeColor = System.Drawing.Color.Blue; }).BindToXML(HttpContext.Current.Server.MapPath("~/App_Data/SideMenu.xml"), "/menu/*").GetHtml()

    Attached is the modified project. Should you have any further questions, feel free to contact us.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.