Skip to main content
Tab

ASPxNavBar.ItemStyle Property

Gets the style settings for all items within the navbar control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.1.dll

NuGet Package: DevExpress.Web

Declaration

public NavBarItemStyle ItemStyle { get; }

Property Value

Type Description
NavBarItemStyle

A NavBarItemStyle object that contains the style settings for the navbar’s items.

Remarks

The ItemStyle property provides access to the style settings which define the appearance style of all items within the navbar control.

A specific item style can be applied to a particular group within the navbar control by using the group’s NavBarGroup.ItemStyle property.

Example

using DevExpress.Web.ASPxNavBar;
...

protected void Page_Load(object sender, EventArgs e) {
     ASPxNavBar ASPxNavBar1 = new ASPxNavBar();
     ASPxNavBar1.AutoPostBack = true;
     ASPxNavBar1.ShowExpandButtons = false;
     ASPxNavBar1.GroupHeaderStyle.HorizontalAlign = HorizontalAlign.Left;
     ASPxNavBar1.ItemStyle.HorizontalAlign = HorizontalAlign.Center;

     NavBarGroup group1 = new NavBarGroup("Group1");
     NavBarGroup group2 = new NavBarGroup("Group2");

     NavBarItem item1 = new NavBarItem("Item1");
     NavBarItem item2 = new NavBarItem("Item2");
     NavBarItem item3 = new NavBarItem("Item3");

     ASPxNavBar1.Groups.Add(group1);
     ASPxNavBar1.Groups.Add(group2);

     group1.Items.Add(item1);
     group2.Items.Add(item2);
     group2.Items.Add(item3);

     group1.HeaderStyle.BackColor = System.Drawing.Color.White;
     group2.HeaderStyle.BackColor = System.Drawing.Color.Red;

     Page.Form.Controls.Add(ASPxNavBar1);       
}
See Also