Skip to main content

XRTableRow Class

A row in an XRTable.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v24.1.dll

NuGet Package: DevExpress.Reporting.Core


public class XRTableRow :


An XRTableRow object contains a collection of table cells. To access these cells, use the row’s Cells property. To add new cells to the row, use the Add method of this property. Utilize the row’s Table property to access the parent table of the current row.

Create a Table at Runtime

The code sample below illustrates how to create an XRTable at runtime.

using DevExpress.XtraReports.UI;
// ...
// Create a report.
XtraReport report = new XtraReport();

// Create a detail band and add it to the report.
DetailBand detailBand = new DetailBand();

// Create a table.
XRTable table = new XRTable();

// Add rows and colums to the table.
int numRows = 10;
int numCols = 20;


for (int i = 0; i < numRows; i++) {
    XRTableRow row = new XRTableRow();

    for (int j = 0; j < numCols; j++) {
        XRTableCell cell = new XRTableCell();

// Set table size.
table.HeightF = 50;
table.WidthF = 500;


// Add the table to the detail band and adjust the band height.
detailBand.HeightF = table.HeightF;

Create a Custom Table

Implement descendants of the XRTable and XRTableRow classes to create a custom table (for instance, a table with a different default row height or with pre-populated cells). Override the protected virtual XRTable.CreateRow and XRTableRow.CreateCell methods. These methods are invoked in all designer operations, except for multiple item drops from the Field List.

The code sample below illustrates custom table implementation.

using DevExpress.XtraReports.UI;
using System.ComponentModel;
// ...

namespace WindowsFormsApplication1 {
    public class XRTableEx : XRTable {
        // Override the CreateRow() method to create a custom table row.
        protected override XRTableRow CreateRow() {
            return new XRTableRowEx();

    // Implement a custom table row with specified height.
    public class XRTableRowEx : XRTableRow {
        public XRTableRowEx()
            : base() {
            SizeF = new System.Drawing.SizeF(120, this.DefaultHeight);

        // Override the CreateCell() method to create a custom table cell.
        protected override XRTableCell CreateCell() {
            return new XRTableCellEx();

        // Specify the default row height.
        protected override int DefaultHeight {
            get {
                return 35;

    // Implement a custom table cell with custom text.
    public class XRTableCellEx : XRTableCell {
        public XRTableCellEx() {
            Text = "MyCustomXRTableCellEx";


See Also