Skip to main content
Tab

ASPxNavBar.GroupHeaderStyle Property

Gets the style settings for all group headers within the navbar control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

public NavBarGroupHeaderStyle GroupHeaderStyle { get; }

Property Value

Type Description
NavBarGroupHeaderStyle

A NavBarGroupHeaderStyle object that contains the style settings for the group headers.

Remarks

The GroupHeaderStyle property provides access to the style settings which define the appearance style of all group headers within the navbar control.

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

In order to define a particular header style for the collapsed state of the navbar’s groups, the ASPxNavBar.GroupHeaderStyleCollapsed property can be used.

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