Skip to main content
A newer version of this page is available. .
Tab

NavBarGroup.HeaderStyle Property

Gets the style settings for the group’s header.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public NavBarGroupHeaderStyle HeaderStyle { get; }

Property Value

Type Description
NavBarGroupHeaderStyle

A NavBarGroupHeaderStyle object that contains the style settings for the group’s header.

Remarks

The HeaderStyle property provides access to the style settings which define the appearance style of the current group’s header.

The common header style can be applied to all groups within a navbar control by using the navbar’s ASPxNavBar.GroupHeaderStyle property

In order to define a particular header style for the collapsed state of the group, use the NavBarGroup.HeaderStyleCollapsed 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