New to Telerik UI for WPFStart a free 30-day trial

Table

Class

Represents a table within the document model.

Definition

Namespace:Telerik.Windows.Documents.Model

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
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

Initializes a new instance of the Table class.

C#
public Table()

Initializes a new instance of the Table class.

C#
public Table(int rowsCount, int columnsCount)
Parameters:rowsCountint

The number of rows of the table.

columnsCountint

The number of columns of the table.

Fields

C#
public static readonly StylePropertyDefinition<Color?, TableProperties> BackgroundProperty
C#
public static readonly StylePropertyDefinition<TableBorders, TableProperties> BordersProperty
C#
public static readonly StylePropertyDefinition<Padding?, TableProperties> CellPaddingProperty
C#
public static readonly StylePropertyDefinition<double?, TableProperties> CellSpacingProperty

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

C#
public static readonly StylePropertyDefinition<int?, TableProperties> ColumnBandSizeProperty
C#
public static readonly StylePropertyDefinition<FlowDirection?, TableProperties> FlowDirectionProperty
C#
public static readonly StylePropertyDefinition<RadHorizontalAlignment?, TableProperties> HorizontalAlignmentProperty
C#
public static readonly StylePropertyDefinition<TableLayoutMode?, TableProperties> LayoutModeProperty
C#
public static readonly StylePropertyDefinition<TableWidthUnit, TableProperties> PreferredWidthProperty

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

C#
public static readonly StylePropertyDefinition<int?, TableProperties> RowBandSizeProperty
C#
public static readonly StylePropertyDefinition<double?, TableProperties> TableIndentProperty
C#
public static readonly StylePropertyDefinition<TableLook, TableProperties> TableLookProperty
C#
public static readonly StylePropertyDefinition<ThemeColorsEnum?, TableProperties> ThemeBackgroundProperty
C#
public static readonly StylePropertyDefinition<string, TableProperties> ThemeFillShadeProperty
C#
public static readonly StylePropertyDefinition<string, TableProperties> ThemeFillTintProperty

Properties

Gets or sets the table background.

C#
[XamlSerializable]
public Color Background { get; set; }
Property Value:

The background.

Gets or sets all borders of the table.

C#
[XamlSerializable]
public TableBorders Borders { get; set; }
Property Value:

The borders.

Gets or sets the cell padding.

C#
[XamlSerializable]
public Padding CellPadding { get; set; }
Property Value:

The cell padding.

Gets or sets the cell spacing.

C#
[XamlSerializable]
public double CellSpacing { get; set; }
Property Value:

The cell spacing.

C#
[XamlSerializable]
public int ColumnBandSize { get; set; }

FlowDirection

FlowDirection

Gets or sets the flow direction of the table contents.

C#
[XamlSerializable]
public FlowDirection FlowDirection { get; set; }
Property Value:

The flow direction.

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

C#
public TableGrid Grid { get; }
Property Value:

The grid.

Gets or sets the horizontal alignment.

C#
[XamlSerializable(RadHorizontalAlignment.Left)]
public RadHorizontalAlignment HorizontalAlignment { get; set; }
Property Value:

The horizontal alignment.

Gets or sets then table layout mode.

C#
[XamlSerializable]
public TableLayoutMode LayoutMode { get; set; }
Property Value:

The layout mode.

Gets or sets the preferred width of the table.

C#
[XamlSerializable]
public TableWidthUnit PreferredWidth { get; set; }
Property Value:

The preferred width.

C#
[XamlSerializable]
public int RowBandSize { get; set; }

Gets the rows.

C#
public TableRowCollection Rows { get; }
Property Value:

The rows.

Gets or sets the table indent.

C#
[XamlSerializable]
public double TableIndent { get; set; }
Property Value:

The table indent.

Gets or sets the table look.

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

C#
[XamlCompositePropertySerializable]
public TableLook TableLook { get; set; }
Property Value:

The table look.

Gets or sets the theme background.

C#
[XamlSerializable]
public ThemeColorsEnum ThemeBackground { get; set; }
Property Value:

The theme background.

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

C#
[XamlSerializable]
public string ThemeFillShade { get; set; }

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

C#
[XamlSerializable]
public string ThemeFillTint { get; set; }

Methods

Adds a column after the last one in the table.

C#
public IEnumerable<TableCell> AddColumn()
Returns:

IEnumerable<TableCell>

A collection of the added TableCells.

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

C#
public IEnumerable<TableCell> AddColumnToTheLeft(TableCell existingCell)
Parameters:existingCellTableCell

The existing TableCell.

Returns:

IEnumerable<TableCell>

A collection of the added TableCells.

Exceptions:

InvalidOperationException

Cell must be from the same table.

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

C#
public IEnumerable<TableCell> AddColumnToTheRight(TableCell existingCell)
Parameters:existingCellTableCell

The existing TableCell.

Returns:

IEnumerable<TableCell>

A collection of the added TableCells.

Exceptions:

InvalidOperationException

Cell must be from the same table.

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

C#
public TableRow AddRow()
Returns:

TableRow

The newly added row.

Adds a TableRow as a last row in the table.

C#
public TableRow AddRow(TableRow newRow)
Parameters:newRowTableRow

The new TableRow.

Returns:

TableRow

The added TableRow instance.

Exceptions:

ArgumentException

Row already added to this table.

Adds a TableRow above an existing one.

C#
public TableRow AddRowAbove(TableRow existingRow, TableRow newRow)
Parameters:existingRowTableRow

The existing TableRow.

newRowTableRow

The new TableRow.

Returns:

TableRow

The added TableRow instance.

Exceptions:

InvalidOperationException

Row must be from the same table.

ArgumentException

Row already added.

Copies a specified TableRow and adds the copy above it.

C#
public TableRow AddRowAbove(TableRow existingRow)
Parameters:existingRowTableRow

The existing row.

Returns:

TableRow

The added TableRow instance.

Adds a TableRow at a specific index.

C#
public TableRow AddRowAtIndex(int index, TableRow rowToAdd)
Parameters:indexint

The index.

rowToAddTableRow

The row to add.

Returns:

TableRow

The added TableRow instance.

Exceptions:

ArgumentException

Incorrect index value.

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

C#
public TableRow AddRowAtIndex(int index)
Parameters:indexint

The index.

Returns:

TableRow

The added TableRow instance.

Exceptions:

ArgumentException

Incorrect index value.

Adds a TableRow below an existing one.

C#
public TableRow AddRowBelow(TableRow existingRow, TableRow newRow)
Parameters:existingRowTableRow

The existing TableRow.

newRowTableRow

The new TableRow.

Returns:

TableRow

The added TableRow instance.

Exceptions:

InvalidOperationException

Row must be from the same table.

ArgumentException

Row already added.

Copies a specified TableRow and adds the copy below it.

C#
public TableRow AddRowBelow(TableRow existingRow)
Parameters:existingRowTableRow

The existing TableRow.

Returns:

TableRow

The added TableRow instance.

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

C#
protected override void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters:fromElementDocumentElement

The Table to copy the properties from.

Overrides: DocumentElement.CopyPropertiesFromOverride(DocumentElement)

Creates a new TableLayoutBox.

C#
public override LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters:documentCollectionDocumentStructureCollection

The document collection.

Returns:

LayoutBox

The new TableLayoutBox.

Overrides: DocumentElement.CreateLayoutBox(DocumentStructureCollection)

Creates a new instance of the Table class.

C#
protected override DocumentElement CreateNewElementInstance()
Returns:

DocumentElement

The new instance.

Overrides: DocumentElement.CreateNewElementInstance()

Deletes a TableRow.

C#
public void DeleteRow(TableRow row)
Parameters:rowTableRow

The row to delete.

Exceptions:

InvalidOperationException

Row must be from the same table.

Gets the width of the grid column.

C#
public TableWidthUnit GetGridColumnWidth(int gridColumnIndex)
Parameters:gridColumnIndexint

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.

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

C#
protected override void OnStyleChanged()

Overrides: DocumentElement.OnStyleChanged()

Sets the width of the grid column.

C#
public void SetGridColumnWidth(int gridColumnIndex, TableWidthUnit width)
Parameters:gridColumnIndexint

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

widthTableWidthUnit

The width.

Exceptions:

ArgumentOutOfRangeException

gridColumnIndex should be greater than or equal to 0.