FlexPivot for WinForms
IndexOf(String,Boolean,Int32) メソッド
使用例 

C1.Win.C1FlexGrid.4.5.2 アセンブリ > C1.Win.C1FlexGrid 名前空間 > ColumnCollection クラス > IndexOf メソッド : IndexOf(String,Boolean,Int32) メソッド
Column name to look for (case-insensitive).
Whether to throw and exception if the column cannot be found.
The search starting index.
Gets the index of the Column with the specified name, optionally throwing an exception if the column is not found. The search starts at a specified index.
シンタックス
'宣言
 
Public Overloads Function IndexOf( _
   ByVal columnName As System.String, _
   ByVal throwIfNotFound As System.Boolean, _
   ByVal startIndex As System.Integer _
) As System.Integer
public System.int IndexOf( 
   System.string columnName,
   System.bool throwIfNotFound,
   System.int startIndex
)

パラメータ

columnName
Column name to look for (case-insensitive).
throwIfNotFound
Whether to throw and exception if the column cannot be found.
startIndex
The search starting index.

戻り値の型

Index of the column that has the given name in this collection, or -1 if the collection does not contain a column with the given name.
解説
If the throwIfNotFound parameter is set to true and a column named columnName cannot be found, the control throws an System.ArgumentOutOfRangeException. This makes it easier to write compact code that relies on column names.
使用例
The example below uses the IndexOf method to convert column names into indices. Note that if the column names are invalid, the exception will be thrown by the IndexOf method (column not found) rather than in the following method, where it would not be as clear (invalid index).
int columnIndex = _flex.Cols.IndexOf("total");
_flex.AutoSizeCol(columnIndex);
参照

ColumnCollection クラス
ColumnCollection メンバ
オーバーロード一覧