NavBarItem.Selected Property

Gets or sets a value that specifies whether the item is selected.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v21.1.dll


public bool Selected { get; set; }

Property Value

Type Default Description


true if the item is selected; otherwise, false.


If the ASPxNavBar.AllowSelectItem property is set to true, end users are allowed to select items via mouse clicks. The navbar also provides the ability to select a particular item via code. You can use the Selected property of an item for this purpose.

Note that the item whose Selected property is set to true is displayed selected only if the item link mode in its group is set to the GroupItemLinkMode.ContentBounds value (which can be specified by either the navbar’s ASPxNavBar.ItemLinkMode or the group’s NavBarGroup.ItemLinkMode property).

In order to select a specific item from the level of a navbar control, use the navbar’s ASPxNavBar.SelectedItem property instead.


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" 

<script runat="server">

<html xmlns="" >
 <head id="Head1" runat="server">
     <title>Selected and Hottrack images</title>
     <form id="form1" runat="server">
         <dxnb:ASPxNavBar ID="ASPxNavBar1" runat="server" AllowExpanding="False" 
              ShowExpandButtons="False" AllowSelectItem="True">
             <Paddings Padding="0px" />
                 <dxnb:NavBarGroup Text="Hottracked item">
                         <dxnb:NavBarItem Text="Selected" Selected="True" />
                         <dxnb:NavBarItem Text="User" />
                         <dxnb:NavBarItem Text="Disabled" Enabled="False" />
             <ItemImage Height="15px" Url="~/ASPxperience/Common/Images/Images/User.gif" 
                 Width="12px" />
See Also