Back to Devexpress

GridViewTemplates.DetailRow Property

aspnet-devexpress-dot-web-dot-gridviewtemplates-db9cc56d.md

latest4.4 KB
Original Source

GridViewTemplates.DetailRow Property

Specifies a template to display detail rows.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(null)]
public virtual ITemplate DetailRow { get; set; }
vb
<DefaultValue(Nothing)>
Public Overridable Property DetailRow As ITemplate

Property Value

TypeDefaultDescription
ITemplatenull

An object that implements the ITemplate interface.

|

Remarks

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.

Example

In the example below, the detail row template contains additional information about an employee.

Run Demo: ASPxGridView - Detail View

aspx
<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>

Online Example

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

csharp
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

vb
masterGrid.Templates.DetailRow = New DetailGridTemplate()
AddHandler masterGrid.RowUpdating, AddressOf masterGrid_RowUpdating

See Also

Grid View Templates

Master-Detail: Implementation

GridViewTemplates Class

GridViewTemplates Members

DevExpress.Web Namespace