Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TableRowCollection Class

A collection of the TableRow objects.

#Declaration

TypeScript
export class TableRowCollection extends TableBaseCollection<TableRow>

#Remarks

An object of this class can be accessed by the rows property.

#Inherited Members

#Methods

#insert(index) Method

Inserts a row above or below the specified row.

#Declaration

TypeScript
insert(
    index: number,
    below?: boolean
): TableRow

#Parameters

Name Type Description
index number

The index of the row relative to which to insert a row.

below boolean

true to insert a row below the specified row; false to insert a row above the specified row.

#Returns

Type Description
TableRow

The newly inserted table row.

#Remarks

Note

The newly inserted row copies appearance settings from the row whose index you passed as the index parameter.

The following code snippet adds a new row above the first table row:

js
const subDocument = richEdit.selection.activeSubDocument;
const table = subDocument.tables.getByIndex(0);
table.rows.insert(0, false);

#remove(index) Method

Removes a row with the specified index from the table.

#Declaration

TypeScript
remove(
    index: number
): void

#Parameters

Name Type Description
index number

A row index in the collection.

#Remarks

Note

Once you remove all rows from a table, the component removes the table from the document.

The following code snippet removes the last row in the table:

js
const subDocument = richEdit.selection.activeSubDocument;
const table = subDocument.tables.getByIndex(0);
table.rows.remove(table.rows.count-1);