Back to Devexpress

XRTableCell.PreviousCell Property

xtrareports-devexpress-dot-xtrareports-dot-ui-dot-xrtablecell-62d1ecab.md

latest2.7 KB
Original Source

XRTableCell.PreviousCell Property

Gets the cell previous to the given cell in a table row.

Namespace : DevExpress.XtraReports.UI

Assembly : DevExpress.XtraReports.v25.2.dll

NuGet Package : DevExpress.Reporting.Core

Declaration

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

Property Value

TypeDescription
XRTableCell

An XRTableCell object representing the previous cell in a row.

|

Remarks

If the index of the given cell has the lowest value in the collection of cells in the row, then the PreviousCell property returns null ( Nothing in Visual Basic).

Example

The following method deletes columns adjacent to the column containing the base cell. Access to the cells adjacent to the base cell is implemented via the XRTableCell.PreviousCell and XRTableCell.NextCell properties.

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

public void DeleteAdjacentColumns(XRTable table, XRTableCell baseCell) {

   if(baseCell.PreviousCell != null)
      // Delete a column containing the cell that is previous to the base cell.
      table.DeleteColumn(baseCell.PreviousCell);

   if(baseCell.NextCell != null)
      // Delete a column containing the cell that is next to the base cell.
      table.DeleteColumn(baseCell.NextCell); 
}
vb
Imports DevExpress.XtraReports.UI
' ...

Public Sub DeleteAdjacentColumns(ByRef table As XRTable, ByRef baseCell As XRTableCell)

   If (Not (baseCell.PreviousCell Is Nothing)) Then
      ' Delete a column containing the cell that is previous to the base cell.
      table.DeleteColumn(baseCell.PreviousCell)
   End If

   If (Not (baseCell.NextCell Is Nothing)) Then
      ' Delete a column containing the cell that is next to the base cell.
      table.DeleteColumn(baseCell.NextCell)
   End If
End Sub

See Also

NextCell

XRTableCell Class

XRTableCell Members

DevExpress.XtraReports.UI Namespace