InsertRow Method


Inserts a row data at a specified index.

Namespace: Autodesk.Revit.DB
Assembly: RevitAPI (in RevitAPI.dll) Version: 24.0.0.0 (24.0.0.0)
Since:  2014

Syntax

C#
public void InsertRow(
	int nIndex
)
Visual Basic
Public Sub InsertRow ( _
	nIndex As Integer _
)
Visual C++
public:
void InsertRow(
	int nIndex
)

Parameters

nIndex
Type: SystemInt32
An integer index.

Examples

CopyC#
public void CreateSubtitle(ViewSchedule schedule)
{
    TableData colTableData = schedule.GetTableData();

    TableSectionData tsd = colTableData.GetSectionData(SectionType.Header);
    tsd.InsertRow(tsd.FirstRowNumber + 1);
    tsd.SetCellText(tsd.FirstRowNumber + 1, tsd.FirstColumnNumber, "Schedule of column top and base levels with offsets");
}
CopyVB.NET
Public Sub CreateSubtitle(schedule As ViewSchedule)
    Dim colTableData As TableData = schedule.GetTableData()

    Dim tsd As TableSectionData = colTableData.GetSectionData(SectionType.Header)
    tsd.InsertRow(tsd.FirstRowNumber + 1)
    tsd.SetCellText(tsd.FirstRowNumber + 1, tsd.FirstColumnNumber, "Schedule of column top and base levels with offsets")
End Sub

Exceptions

ExceptionCondition
Autodesk.Revit.ExceptionsArgumentException The row can't be inserted in data section of standard schedule except Key Schedule, Sheet List Schedule or following categories without emdeded schedule: MEP Space, Room, Area. or nIndex is invalid index.

See Also