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

ASPxTabControl.NameField Property

Gets or sets the name of a data field (or an xml element’s attribute) which provides tab unique identifier names.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue("")]
public string NameField { get; set; }

Property Value

Type Default Description
String String.Empty

A string value that specifies the name of the required data source field.

Remarks

The NameField property is in effect if the ASPxTabControl control is bound to a data source (via the ASPxDataWebControlBase.DataSourceID or ASPxDataWebControlBase.DataSource property).

Use the NameField property to specify the bound data source’s data field (or an xml element’s attribute) which stores unique identifier names of tabs. The NameField property maps the TabBase.Name properties of TabBase objects to the specified data field’s values.

If the NameField property of a data bound ASPxTabControl control is not defined, the control can automatically obtain tab unique identifiers from a data field whose name is “Name” (which is equal to the TabBase.Name property’s name). You can also handle the ASPxTabControl.TabDataBound event to manipulate a tab’s settings as required.

Example

This sample demonstrates how to bind the ASPxTabControl to an XML data file. XML data are retrieved from the file via an XmlDataSource component whose XPath property is specifically defined. The XmlDataSource is used as a data source for the ASPxTabControl.Based on the source data, the ASPxTabControl populates its Tabs collection with automatically created Tab objects. Tab object characteristics (such as text, image, navigate location, tooltip text, etc) are obtained from the data source's data fields (node attributes).In this demo, the required data fields (node attributes) from which to retrieve tab data are indicated using the following specific data-related properties of the ASPxTabControl:ActiveTabImageUrlField,NameField,NavigateUrlField,TabImageUrlField, TextField and ToolTipField.

For more information about these properties see:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

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

    }
}
See Also