XRTableRowCollection.FirstRow Property
Gets the first row in the collection of rows in the table.
Namespace: DevExpress.XtraReports.UI
Assembly: DevExpress.XtraReports.v24.1.dll
NuGet Package: DevExpress.Reporting.Core
Declaration
Property Value
Type | Description |
---|---|
XRTableRow | An XRTableRow object occupying the uppermost position in the table. |
Remarks
The first row in the collection of table rows is always located in the uppermost position in a table.
Example
The following code demonstrates different ways of inserting cells and columns into an XRTable control. The original table contains one column. The second column is created by adding two individual cells using the XRTableRow.InsertCell method. The third and fourth columns are added by the XRTable.InsertColumnToRight and XRTable.InsertColumnToLeft methods, correspondingly.
using System.Drawing;
using DevExpress.XtraReports.UI;
// ...
public XRTable CreateTable() {
// Create an XRTable object containing two rows and one column.
XRTable tab = XRTable.CreateTable(new Rectangle(200, 10, 200, 120), 2, 1);
// Set the visible borders and their width for each table cell.
tab.Borders = DevExpress.XtraPrinting.BorderSide.All;
tab.BorderWidth = 2;
// Create new cells.
XRTableCell cell0 = new XRTableCell();
XRTableCell cell1 = new XRTableCell();
// Insert the new cells into the appropriate rows.
tab.Rows.FirstRow.InsertCell(cell0, 0);
tab.Rows.LastRow.InsertCell(cell1, 0);
// The table has two columns now.
// Insert a column to the right of the first row cell.
tab.InsertColumnToRight(cell1);
// The table has three columns now.
// Insert a column to the left of the second row cell.
tab.InsertColumnToLeft(cell1.NextCell);
// The table has four columns now.
return tab;
}