Back to Devexpress

XRTableCellCollection.Item[Int32] Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrtablecellcollection-dot-item-x28-system-dot-int32-x29.md

latest3.2 KB
Original Source

XRTableCellCollection.Item[Int32] Property

An indexer that returns the XRTableCell object at the specified index in the collection of cells.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

csharp
public XRTableCell this[int index] { get; }
vb
Public ReadOnly Property Item(index As Integer) As XRTableCell

Parameters

NameTypeDescription
indexInt32

An integer index value that locates the cell in the collection.

|

Property Value

TypeDescription
XRTableCell

An XRTableCell object that has the specified index in the collection of cells.

|

Remarks

The index type of the XRTableCellCollection is a zero-based index.

Example

The following example demonstrates how to create an XRTableRow object at runtime, via the XRTableRow.CreateRow method, and set some of its main properties.

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

public XRTableRow CreateXRTableRow() {
    // Create a table row containing three cells.
    XRTableRow row = XRTableRow.CreateRow(new SizeF(300F, 50F), 3);

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

    // Set the border width for the row's cells.
    row.BorderWidth = 2;

    // Set the size of the cells.
    row.Cells[0].SizeF = new SizeF(120F, 50F);
    row.Cells[1].SizeF = new SizeF(90F, 50F);
    row.Cells[2].SizeF = new SizeF(90F, 50F);

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

Public Function CreateXRTableRow() As XRTableRow
    ' Create a table row containing three cells.
    Dim Row = XRTableRow.CreateRow(New SizeF(300F, 50F), 3)

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

    ' Set the border width for the row's cells.
    Row.BorderWidth = 2

    ' Set the size of the cells.
    Row.Cells(0).SizeF = New SizeF(120F, 50F)
    Row.Cells(1).SizeF = New SizeF(90F, 50F)
    Row.Cells(2).SizeF = New SizeF(90F, 50F)

    Return Row
End Function

See Also

XRTableCellCollection Class

XRTableCellCollection Members

DevExpress.XtraReports.UI Namespace