System.Web.UI.WebControls.DetailsView.EmptyDataTemplate Property

Gets or sets the user-defined content for the empty data row rendered when a System.Web.UI.WebControls.DetailsView control is bound to a data source that does not contain any records.

Syntax

[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
[System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.DetailsView), System.ComponentModel.BindingDirection.OneWay)]
[System.ComponentModel.DefaultValue(null)]
public virtual System.Web.UI.ITemplate EmptyDataTemplate { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The empty data row is displayed in a System.Web.UI.WebControls.DetailsView control when the data source that is bound to the control does not contain any records. You can define your own custom user interface (UI) for the empty data row by using the DetailsView.EmptyDataTemplate property. To specify a custom template for the null row, first place <EmptyDataTemplate> tags between the opening and closing tags of the System.Web.UI.WebControls.DetailsView control. You can then list the contents of the template between the opening and closing <EmptyDataTemplate> tags. To control the style of the empty data row, use the DetailsView.EmptyDataRowStyle property. Alternatively, you can use the built-in UI for the empty data row by setting the DetailsView.EmptyDataText property instead of this property.

Note:

If both the DetailsView.EmptyDataText and DetailsView.EmptyDataTemplate properties are set, the DetailsView.EmptyDataTemplate property takes precedence.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0