GridData.InsertColumn

導入

v12.0 (2014)

説明

指定したインデックスに列を挿入します。新しい列タイプは siColumnStandard になります。SetColumnType または SetColumnDef を呼び出すことにより、後で変更することができます。既存の列は、新しく挿入される列に合わせるために右に移動します。

C#構文

GridData.InsertColumn( Int32 in_lColumnIndex );

スクリプト構文

GridData.InsertColumn( Index );

パラメータ

パラメータ タイプ 説明
Index Long 新しく挿入される列のインデックス。-1 を渡すとテーブルの末尾に新しい列が挿入されます。

Python の例

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 column 0 and 1

gridData.InsertColumn( 1 )

Application.InspectObj( siProperty )

関連項目

GridData.SetColumnType