aspnet-devexpress-dot-web-dot-gridviewtemplates-db9cc56d.md
Specifies a template to display detail rows.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
[DefaultValue(null)]
public virtual ITemplate DetailRow { get; set; }
<DefaultValue(Nothing)>
Public Overridable Property DetailRow As ITemplate
| Type | Default | Description |
|---|---|---|
| ITemplate | null |
An object that implements the ITemplate interface.
|
Set the ShowDetailRow property to true to show detail rows.
When you specify the DetailRow property, the control creates a template within a container object of the GridViewDetailRowTemplateContainer type.
Refer to the Create Templates topic for information on how to create templates for the Grid View control’s elements.
In the example below, the detail row template contains additional information about an employee.
Run Demo: ASPxGridView - Detail View
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False">
<SettingsDetail ShowDetailRow="true" />
<Templates>
<DetailRow>
Region:
<dx:ASPxLabel ID="region" runat="server" Text='<%# Eval("Region") %>' Font-Bold="true"/>
, City:
<dx:ASPxLabel ID="city" runat="server" Text='<%# Eval("City") %>' Font-Bold="true"/>
</DetailRow>
</Templates>
</dx:ASPxGridView>
View Example: Display a custom error message in a detail row on the client
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DetailRow property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
asp-net-web-forms-grid-create-master-detail-grid-at-runtime/CS/MasterDetailGrids/Default.aspx.cs#L37
masterGrid.Templates.DetailRow = new DetailGridTemplate();
masterGrid.RowUpdating += new DevExpress.Web.Data.ASPxDataUpdatingEventHandler(masterGrid_RowUpdating);
asp-net-web-forms-grid-create-master-detail-grid-at-runtime/VB/MasterDetailGrids/Default.aspx.vb#L39
masterGrid.Templates.DetailRow = New DetailGridTemplate()
AddHandler masterGrid.RowUpdating, AddressOf masterGrid_RowUpdating
See Also