Class
Table

Represents a table within the document model.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public class Table : Block

Inheritance: objectDocumentElementBlockTable

Inherited Members DocumentElement.GetStyleProperty(IStylePropertyDefinition)DocumentElement.GetStyleProperty(string)DocumentElement.EnumerateChildrenOfType<T>()DocumentElement.GetParentOfType<T>()DocumentElement.CreateLayoutBox()DocumentElement.CopyPropertiesFrom(DocumentElement)DocumentElement.CopyPropertiesFromStyle(StyleDefinition)DocumentElement.ExtractStyleFromProperties()DocumentElement.ExtractStyleFromLocalProperties()DocumentElement.InvalidateAssociatedBoxesArrange()DocumentElement.InvalidateAssociatedBoxesMeasure()DocumentElement.InvalidateAssociatedBoxesLayout()DocumentElement.GetAssociatedLayoutBoxes()DocumentElement.GetRootDocument()DocumentElement.CreateDeepCopy()DocumentElement.CreateShallowCopy()DocumentElement.GetPropertyValueSource(IStylePropertyDefinition)DocumentElement.ClearValue(IStylePropertyDefinition)DocumentElement.OnRemoved()DocumentElement.OnStyleChanging()DocumentElement.OnStylePropertyChanged(StylePropertyChangeEventArgs)DocumentElement.OnParentChanging()DocumentElement.OnParentChanged()DocumentElement.ChildIndexDocumentElement.HasStyleDocumentElement.StyleDocumentElement.StyleNameDocumentElement.TagDocumentElement.FirstLayoutBoxDocumentElement.IsFirstLayoutBoxInitializedDocumentElement.DocumentElementsDocumentElement.ParentDocumentElement.ChildrenDocumentElement.PreviousSiblingDocumentElement.NextSiblingDocumentElement.CursorDocumentElement.StyleChangingDocumentElement.StyleChangedDocumentElement.StylePropertyChangedDocumentElement.ParentChangingDocumentElement.ParentChangedDocumentElement.PropertyValueChanged

Constructors

Table()

Initializes a new instance of the Table class.

Declaration

cs-api-definition
public Table()

Table(int, int)

Initializes a new instance of the Table class.

Declaration

cs-api-definition
public Table(int rowsCount, int columnsCount)

Parameters

rowsCount

int

The number of rows of the table.

columnsCount

int

The number of columns of the table.

Fields

BackgroundProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<Color?, TableProperties> BackgroundProperty

Field Value

StylePropertyDefinition<Color?, TableProperties>

BordersProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<TableBorders, TableProperties> BordersProperty

Field Value

StylePropertyDefinition<TableBorders, TableProperties>

CellPaddingProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<Padding?, TableProperties> CellPaddingProperty

Field Value

StylePropertyDefinition<Padding?, TableProperties>

CellSpacingProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<double?, TableProperties> CellSpacingProperty

Field Value

StylePropertyDefinition<double?, TableProperties>

ColumnBandSizeProperty

Represents the size of a column band in a table within the Telerik document model.

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<int?, TableProperties> ColumnBandSizeProperty

Field Value

StylePropertyDefinition<int?, TableProperties>

FlowDirectionProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<FlowDirection?, TableProperties> FlowDirectionProperty

Field Value

StylePropertyDefinition<FlowDirection?, TableProperties>

HorizontalAlignmentProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<RadHorizontalAlignment?, TableProperties> HorizontalAlignmentProperty

Field Value

StylePropertyDefinition<RadHorizontalAlignment?, TableProperties>

LayoutModeProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<TableLayoutMode?, TableProperties> LayoutModeProperty

Field Value

StylePropertyDefinition<TableLayoutMode?, TableProperties>

PreferredWidthProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<TableWidthUnit, TableProperties> PreferredWidthProperty

Field Value

StylePropertyDefinition<TableWidthUnit, TableProperties>

RowBandSizeProperty

Represents the size of a row band in a table, defining the visual layout and appearance of the rows.

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<int?, TableProperties> RowBandSizeProperty

Field Value

StylePropertyDefinition<int?, TableProperties>

TableIndentProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<double?, TableProperties> TableIndentProperty

Field Value

StylePropertyDefinition<double?, TableProperties>

TableLookProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<TableLook, TableProperties> TableLookProperty

Field Value

StylePropertyDefinition<TableLook, TableProperties>

ThemeBackgroundProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<ThemeColorsEnum?, TableProperties> ThemeBackgroundProperty

Field Value

StylePropertyDefinition<ThemeColorsEnum?, TableProperties>

ThemeFillShadeProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<string, TableProperties> ThemeFillShadeProperty

Field Value

StylePropertyDefinition<string, TableProperties>

ThemeFillTintProperty

Declaration

cs-api-definition
public static readonly StylePropertyDefinition<string, TableProperties> ThemeFillTintProperty

Field Value

StylePropertyDefinition<string, TableProperties>

Properties

Background

Gets or sets the table background.

Declaration

cs-api-definition
[XamlSerializable]
public Color Background { get; set; }

Property Value

Color

The background.

Borders

Gets or sets all borders of the table.

Declaration

cs-api-definition
[XamlSerializable]
public TableBorders Borders { get; set; }

Property Value

TableBorders

The borders.

CellPadding

Gets or sets the cell padding.

Declaration

cs-api-definition
[XamlSerializable]
public Padding CellPadding { get; set; }

Property Value

Padding

The cell padding.

CellSpacing

Gets or sets the cell spacing.

Declaration

cs-api-definition
[XamlSerializable]
public double CellSpacing { get; set; }

Property Value

double

The cell spacing.

ColumnBandSize

Declaration

cs-api-definition
[XamlSerializable]
public int ColumnBandSize { get; set; }

Property Value

int

FlowDirection

Gets or sets the flow direction of the table contents.

Declaration

cs-api-definition
[XamlSerializable]
public FlowDirection FlowDirection { get; set; }

Property Value

FlowDirection

The flow direction.

Grid

Gets the grid of the table which keeps information about the rows and columns.

Declaration

cs-api-definition
public TableGrid Grid { get; }

Property Value

TableGrid

The grid.

HorizontalAlignment

Gets or sets the horizontal alignment.

Declaration

cs-api-definition
[XamlSerializable(RadHorizontalAlignment.Left)]
public RadHorizontalAlignment HorizontalAlignment { get; set; }

Property Value

RadHorizontalAlignment

The horizontal alignment.

LayoutMode

Gets or sets then table layout mode.

Declaration

cs-api-definition
[XamlSerializable]
public TableLayoutMode LayoutMode { get; set; }

Property Value

TableLayoutMode

The layout mode.

PreferredWidth

Gets or sets the preferred width of the table.

Declaration

cs-api-definition
[XamlSerializable]
public TableWidthUnit PreferredWidth { get; set; }

Property Value

TableWidthUnit

The preferred width.

RowBandSize

Declaration

cs-api-definition
[XamlSerializable]
public int RowBandSize { get; set; }

Property Value

int

Rows

Gets the rows.

Declaration

cs-api-definition
public TableRowCollection Rows { get; }

Property Value

TableRowCollection

The rows.

TableIndent

Gets or sets the table indent.

Declaration

cs-api-definition
[XamlSerializable]
public double TableIndent { get; set; }

Property Value

double

The table indent.

TableLook

Gets or sets the table look.

The look of a table defines the components of the conditional formatting which will be applied to it.

Declaration

cs-api-definition
[XamlCompositePropertySerializable]
public TableLook TableLook { get; set; }

Property Value

TableLook

The table look.

ThemeBackground

Gets or sets the theme background.

Declaration

cs-api-definition
[XamlSerializable]
public ThemeColorsEnum ThemeBackground { get; set; }

Property Value

ThemeColorsEnum

The theme background.

ThemeFillShade

Represents the fill shade of a table theme in Telerik's document model.

Declaration

cs-api-definition
[XamlSerializable]
public string ThemeFillShade { get; set; }

Property Value

string

ThemeFillTint

Represents the tint applied to the theme fill of a table in the Telerik document model.

Declaration

cs-api-definition
[XamlSerializable]
public string ThemeFillTint { get; set; }

Property Value

string

Methods

AddColumn()

Adds a column after the last one in the table.

Declaration

cs-api-definition
public IEnumerable<TableCell> AddColumn()

Returns

IEnumerable<TableCell>

A collection of the added TableCells.

AddColumnToTheLeft(TableCell)

Adds a column on the left side of an existing cell.

Declaration

cs-api-definition
public IEnumerable<TableCell> AddColumnToTheLeft(TableCell existingCell)

Parameters

existingCell

TableCell

The existing TableCell.

Returns

IEnumerable<TableCell>

A collection of the added TableCells.

Exceptions

InvalidOperationException

Cell must be from the same table.

AddColumnToTheRight(TableCell)

Adds a column on the right side of an existing cell.

Declaration

cs-api-definition
public IEnumerable<TableCell> AddColumnToTheRight(TableCell existingCell)

Parameters

existingCell

TableCell

The existing TableCell.

Returns

IEnumerable<TableCell>

A collection of the added TableCells.

Exceptions

InvalidOperationException

Cell must be from the same table.

AddRow()

Adds copy of the last TableRow in the table. If the table doesn't have any rows, then a new TableRow is added.

Declaration

cs-api-definition
public TableRow AddRow()

Returns

TableRow

The newly added row.

AddRow(TableRow)

Adds a TableRow as a last row in the table.

Declaration

cs-api-definition
public TableRow AddRow(TableRow newRow)

Parameters

newRow

TableRow

The new TableRow.

Returns

TableRow

The added TableRow instance.

Exceptions

ArgumentException

Row already added to this table.

AddRowAbove(TableRow)

Copies a specified TableRow and adds the copy above it.

Declaration

cs-api-definition
public TableRow AddRowAbove(TableRow existingRow)

Parameters

existingRow

TableRow

The existing row.

Returns

TableRow

The added TableRow instance.

AddRowAbove(TableRow, TableRow)

Adds a TableRow above an existing one.

Declaration

cs-api-definition
public TableRow AddRowAbove(TableRow existingRow, TableRow newRow)

Parameters

existingRow

TableRow

The existing TableRow.

newRow

TableRow

The new TableRow.

Returns

TableRow

The added TableRow instance.

Exceptions

InvalidOperationException

Row must be from the same table.

ArgumentException

Row already added.

AddRowAtIndex(int)

Adds a copy of the nearest TableRow at a specific index.

Declaration

cs-api-definition
public TableRow AddRowAtIndex(int index)

Parameters

index

int

The index.

Returns

TableRow

The added TableRow instance.

Exceptions

ArgumentException

Incorrect index value.

AddRowAtIndex(int, TableRow)

Adds a TableRow at a specific index.

Declaration

cs-api-definition
public TableRow AddRowAtIndex(int index, TableRow rowToAdd)

Parameters

index

int

The index.

rowToAdd

TableRow

The row to add.

Returns

TableRow

The added TableRow instance.

Exceptions

ArgumentException

Incorrect index value.

AddRowBelow(TableRow)

Copies a specified TableRow and adds the copy below it.

Declaration

cs-api-definition
public TableRow AddRowBelow(TableRow existingRow)

Parameters

existingRow

TableRow

The existing TableRow.

Returns

TableRow

The added TableRow instance.

AddRowBelow(TableRow, TableRow)

Adds a TableRow below an existing one.

Declaration

cs-api-definition
public TableRow AddRowBelow(TableRow existingRow, TableRow newRow)

Parameters

existingRow

TableRow

The existing TableRow.

newRow

TableRow

The new TableRow.

Returns

TableRow

The added TableRow instance.

Exceptions

InvalidOperationException

Row must be from the same table.

ArgumentException

Row already added.

CopyPropertiesFromOverride(DocumentElement)

Copies the properties of a Table instance to the current object.

Declaration

cs-api-definition
protected override void CopyPropertiesFromOverride(DocumentElement fromElement)

Parameters

fromElement

DocumentElement

The Table to copy the properties from.

Overrides DocumentElement.CopyPropertiesFromOverride(DocumentElement)

CreateLayoutBox(DocumentStructureCollection)

Creates a new TableLayoutBox.

Declaration

cs-api-definition
public override LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)

Parameters

documentCollection

DocumentStructureCollection

The document collection.

Returns

LayoutBox

The new TableLayoutBox.

Overrides DocumentElement.CreateLayoutBox(DocumentStructureCollection)

CreateNewElementInstance()

Creates a new instance of the Table class.

Declaration

cs-api-definition
protected override DocumentElement CreateNewElementInstance()

Returns

DocumentElement

The new instance.

Overrides DocumentElement.CreateNewElementInstance()

DeleteRow(TableRow)

Deletes a TableRow.

Declaration

cs-api-definition
public void DeleteRow(TableRow row)

Parameters

row

TableRow

The row to delete.

Exceptions

InvalidOperationException

Row must be from the same table.

GetGridColumnWidth(int)

Gets the width of the grid column.

Declaration

cs-api-definition
public TableWidthUnit GetGridColumnWidth(int gridColumnIndex)

Parameters

gridColumnIndex

int

Index of the grid column. This index should not be affected of any merged cells.

Returns

TableWidthUnit

A TableWidthUnit representing the width of the column.

OnStyleChanged()

Called after the style of a document element has been changed.

Declaration

cs-api-definition
protected override void OnStyleChanged()

Overrides DocumentElement.OnStyleChanged()

SetGridColumnWidth(int, TableWidthUnit)

Sets the width of the grid column.

Declaration

cs-api-definition
public void SetGridColumnWidth(int gridColumnIndex, TableWidthUnit width)

Parameters

gridColumnIndex

int

Index of the grid column. This index should not be affected of any merged cells.

width

TableWidthUnit

The width.

Exceptions

ArgumentOutOfRangeException

gridColumnIndex should be greater than or equal to 0.