Skip to main content

GridViewTemplates.DataRow Property

Specifies a template to display data rows.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public virtual ITemplate DataRow { get; set; }

Property Value

Type Default Description
ITemplate null

An object that implements the ITemplate interface.


When you specify the DataRow property, the control creates a template within a container object of the GridViewDataRowTemplateContainer type.

Refer to the Create Templates topic for information on how to create templates for the Grid View control’s elements.


The code sample below uses a data row template to create a custom cell layout within data rows.

Run Demo: ASPxGridView - Data Row Template

ASPxGridView.Templates - DataRow

<dx:ASPxGridView ID="grid" runat="server" AutoGenerateColumns="false">
            <div style="padding: 5px">
                        <td rowspan="4">
                            <dx:ASPxBinaryImage ID="ASPxBinaryImage1" runat="server"
                                Value='<%# Eval("Photo") %>' />
                        <td>First Name</td>
                        <td><%# Eval("FirstName") %></td>
                        <td>Last Name</td>
                        <td>%# Eval("LastName") %></td>
                        <td colspan="3"><%# Eval("Title") %></td>
                        <td>Birth Date</td>
                        <td><%# Eval("BirthDate", "{0:d}") %></td>
                        <td>Hire Date</td>
                        <td><%# Eval("HireDate", "{0:d}") %></td>
                        <td colspan="4" style="vertical-align: top;">
                            <dx:ASPxLabel ID="lblNotes" runat="server" Text='<%# Eval("Notes") %>' />
See Also