Back to Devexpress

XRTableCell.Row Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrtablecell-6ea6f587.md

latest2.6 KB
Original Source

XRTableCell.Row Property

Gets a parent row for the XRTableCell object.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
[Browsable(false)]
public XRTableRow Row { get; }
vb
<Browsable(False)>
Public ReadOnly Property Row As XRTableRow

Property Value

TypeDescription
XRTableRow

An object of the XRTableRow class.

|

Example

The following method sets some of the properties of cells in a table row (whose cells are accessed via the XRTableRow.Cells collection). The table row is determined via the XRTableCell.Row property of the cell, passed as a parameter to the method.

csharp
using System.Drawing;
using DevExpress.XtraPrinting;
using DevExpress.XtraReports.UI;
// ...

public void SetTextInRow(XRTableCell baseCell) {

    foreach(XRTableCell cell in baseCell.Row.Cells) {

        // Set the background color for each cell in a row.
        cell.BackColor = Color.LightCyan;

        // Set the text for each cell in a row.
        cell.Text = "Test";

        // Align the text in the cell to the center.
        cell.TextAlignment = TextAlignment.MiddleCenter;
    }
}
vb
Imports System.Drawing
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...

Public Sub SetTextInRow(ByRef baseCell As XRTableCell)

    ' Create an XRTableCell object.
    Dim cell As XRTableCell

    For Each cell In baseCell.Row.Cells

        ' Set the background color for each cell in a row.
        cell.BackColor = Color.LightCyan

        ' Set the text for each cell in a row.
        cell.Text = "Test"

        ' Align the text in the cell to the center.
        cell.TextAlignment = TextAlignment.MiddleCenter;
    Next
End Sub

See Also

XRTableCell Class

XRTableCell Members

DevExpress.XtraReports.UI Namespace