Skip to main content
Tab

NavBarItem.Enabled Property

Gets or sets a value that indicates whether the item is enabled, allowing the item to respond to end-user interactions.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

NuGet Package: DevExpress.Web

#Declaration

[DefaultValue(true)]
public bool Enabled { get; set; }

#Property Value

Type Default Description
Boolean true

true if the item is enabled; otherwise, false.

#Remarks

When this property is set to false, the item doesn’t respond to end-user interactions, such as mouse hovering or clicks.

Note

If a navbar item is disabled on the server by setting the Enabled property to false, the item can’t be enabled on the client by using the clientASPxClientNavBarItem.SetEnabled method.

#Example

This example demonstrates how images for the selected, hot-tracked and disabled item states can be defined within a web control (the ASPxNavBar in this case).

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="DevExpress.Web.v8.3" Namespace="DevExpress.Web.ASPxNavBar" 
TagPrefix="dxnb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 

<script runat="server">
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
 <head id="Head1" runat="server">
     <title>Selected and Hottrack images</title>
 </head>
 <body>
     <form id="form1" runat="server">
     <div>
         <dxnb:ASPxNavBar ID="ASPxNavBar1" runat="server" AllowExpanding="False" 
              ShowExpandButtons="False" AllowSelectItem="True">
             <Paddings Padding="0px" />
             <Groups>
                 <dxnb:NavBarGroup Text="Hottracked item">
                     <Items>
                         <dxnb:NavBarItem Text="Selected" Selected="True" />
                         <dxnb:NavBarItem Text="User" />
                         <dxnb:NavBarItem Text="Disabled" Enabled="False" />
                     </Items>
                 </dxnb:NavBarGroup>
             </Groups>
             <ItemImage Height="15px" Url="~/ASPxperience/Common/Images/Images/User.gif" 
                UrlDisabled="~/ASPxperience/Common/Images/Images/UserDisabled.gif"
                 UrlHottracked="~/ASPxperience/Common/Images/Images/UserHottracked.gif" 
                UrlSelected="~/ASPxperience/Common/Images/Images/UserSelected.gif"
                 Width="12px" />
         </dxnb:ASPxNavBar>
     </div>
     </form>
 </body>
 </html>
See Also