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

NavBarItem() Constructor

Initializes a new instance of the NavBarItem class.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

public NavBarItem()

Remarks

Use this constructor to create a new instance of a NavBarItem class without any specific settings such as the display text or an URL.

Note

When this constructor is used, all properties in the NavBarItem object are set to their default values. Make sure to set the properties, as necessary, after creating the object.

This constructor is commonly used when dynamically populating the NavBarGroup.Items collection of a NavBarGroup object.

Example

This example demonstrates how the ASPxNavBar.GroupDataBound and the ASPxNavBar.ItemDataBound events can be used.

protected void ASPxNavBar1_GroupDataBound(object source, DevExpress.Web.NavBarGroupEventArgs e) {
     NavBarItem btnItem = e.Group.Items.Add();
     btnItem.Template = LoadControl("ContentTemplate.ascx") as ITemplate;
}
protected void ASPxNavBar1_ItemDataBound(object source, NavBarItemEventArgs e) {
     if (e.Item.Text == "Canon EOS 400D") {
          e.Item.Text = e.Item.Text + " (New model)"; 
     }
}
See Also