## GridData.InsertRow

### Introduced

v12.0 (2014)

### Description

Inserts a row at the given index. Pre-existing rows are shifted down in order to accommodate the newly inserted row.

### C# Syntax

    GridData.InsertRow( Int32 in_lRowIndex );

### Scripting Syntax

    GridData.InsertRow( Index );

### Parameters

Parameter | Type | Description
--- | --- | ---
Index | Long | Index of the newly inserted row. Passing -1 will insert a new row at the end of the table.

### Examples

#### Python Example

    import win32com.client

    from win32com.client import constants as C

    propName = "TheProperty"

    gridDataName = "TheGrid"

    siProperty = Application.ActiveSceneRoot.AddProperty( "CustomProperty", False, propName )

    gridData = siProperty.AddGridParameter( gridDataName ).Value ;

    gridData.ColumnCount = 2

    gridData.RowCount = 2

    for row in range( 2 ):

    	gridData.SetRowLabel( row, "Row %d"%row )

    	for col in range( 2 ):

    		# Only set column labels once (when processing the first row)

    		if row == 0:

    			gridData.SetColumnLabel( col, "Col %d"%col )

    		gridData.SetCell( col, row, "%d,%d"%( col, row ) )

    # Insert a blank column between row 0 and 1

    gridData.InsertRow( 1 )

    Application.InspectObj( siProperty )

### See Also

GridData.SetColumnType