Back to Devexpress

XRTable.InsertRowAbove(XRTableRow) Method

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrtable-dot-insertrowabove-x28-devexpress-dot-xtrareports-dot-ui-dot-xrtablerow-x29.md

latest3.4 KB
Original Source

XRTable.InsertRowAbove(XRTableRow) Method

Inserts a row into the table above the given row.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public XRTableRow InsertRowAbove(
    XRTableRow baseRow
)
vb
Public Function InsertRowAbove(
    baseRow As XRTableRow
) As XRTableRow

Parameters

NameTypeDescription
baseRowXRTableRow

An XRTableRow object representing a row, above which a new row is inserted.

|

Returns

TypeDescription
XRTableRow

An XRTableRow object inserted into the table.

|

Example

The following example demonstrates how to create an XRTable control at runtime. To do this, the XRTable.CreateTable, XRTable.InsertRowBelow and XRTable.InsertRowAbove methods are used.

After performing the code below, a table with five rows and three columns should be created.

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

public XRTable CreateTable1() {
    // Create a table containing three rows and three columns.
    XRTable tab = XRTable.CreateTable(new Rectangle(10, 10, 300, 120), 3, 3);

    // Set the border width for all table cells at a time.
    tab.BorderWidth = 2;

    // Make the borders visible for all table cells.
    tab.Borders = DevExpress.XtraPrinting.BorderSide.All;

    // Insert a new row into the table above the first row.
    tab.InsertRowAbove(tab.Rows[0]);

    // Insert a new row into the table below the last row.
    tab.InsertRowBelow(tab.Rows[3]);

    return tab;
}
vb
Imports System.Drawing
Imports DevExpress.XtraReports.UI
' ...

Public Function CreateTable1()
    ' Create a table containing three rows and three columns.
    Dim tab = XRTable.CreateTable(New Rectangle(10, 10, 300, 120), 3, 3)

    ' Set the border width for all table cells at a time.
    tab.BorderWidth = 2

    ' Make the borders visible for all table cells.
    tab.Borders = DevExpress.XtraPrinting.BorderSide.All

    ' Insert a new row into the table above the first row.
    tab.InsertRowAbove(tab.Rows(0))

    ' Insert a new row into the table below the last row.
    tab.InsertRowBelow(tab.Rows(3))

    Return tab
End Function

See Also

XRTable Class

XRTable Members

DevExpress.XtraReports.UI Namespace