Back to Devexpress

TableRowCollection Class

aspnetcore-js-devexpress-dot-richedit-bfb29e96.md

latest2.1 KB
Original Source

TableRowCollection Class

A collection of the TableRow objects.

Declaration

ts
export class TableRowCollection extends TableBaseCollection<TableRow>

Remarks

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

Inherited Members

count

getByIndex(index)

Methods

insert(index) Method

Inserts a row above or below the specified row.

Declaration

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

Parameters

NameTypeDescription
indexnumber

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

TypeDescription
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

ts
remove(
    index: number
): void

Parameters

NameTypeDescription
indexnumber

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);