Skip to main content
Tab

ASPxNavBar.ItemTemplate Property

Gets or sets a common template used for displaying the content of all items within the navbar control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

[DefaultValue(null)]
public virtual ITemplate ItemTemplate { get; set; }

Property Value

Type Default Description
ITemplate null

An object supporting the System.Web.UI.ITemplate interface which contains the template used for displaying the content of all items within the navbar.

Remarks

Use the ItemTemplate property to define a common content for all items within the current navbar control. The template created using this property replaces the content of each item within the navbar - in particular, the item’s image and text specified.

Note that any style settings defined for the items via the specific properties (such as the ASPxNavBar.ItemStyle or NavBarGroup.ItemStyle) are still in effect for the items whose contents are specified through using the ItemTemplate property.

The content of items within a particular group can be defined using the group’s NavBarGroup.ItemTemplate property.

Note

Once a template defined via the ItemTemplate property is created within a control, it is instantiated within a container object of the NavBarItemTemplateContainer type. This container object exposes a set of specific properties to which the template’s child controls can be bound.

Example

This example demonstrates how to bind the ASPxNavBar control to the XmlDataSource. This example also shows how to work with GroupHeaderTemplate and ItemTemplate templates.

View Example

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class ASPxperience_NavBar_Binding_Binding : System.Web.UI.Page {
    protected void Page_Load(object sender, EventArgs e) {

    }
}
See Also