Click or drag to resize

DataColumnCollectionEnsureExistenceAtPositionStrictly(Int32, String, Type, ColumnKind, Int32) Method

Ensures the existence of a column with exactly the provided properties at the provided position.

Namespace: Altaxo.Data
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public DataColumn EnsureExistenceAtPositionStrictly(
	int columnNumber,
	string columnName,
	Type expectedColumnType,
	ColumnKind columnKind,
	int groupNumber
)

Parameters

columnNumber  Int32
The column number. Have to be in the range (0..ColumnCount). If the value is ColumnCount, a new column is added.
columnName  String
Name of the column. If another column with the same name exists, the existing column with the same name will be renamed (if the existing column has a higher column number). If the existing column with the same name has a lower column number, an exception is thrown.
expectedColumnType  Type
Expected type of the column. If a column with the provided type exists at the provided position, this column is used. If the column at the provided position is of a different type, a new column with the provided type is created, and is then used to replace the column at the provided position.
columnKind  ColumnKind
Kind of the column.
groupNumber  Int32
The group number of the column.

Return Value

DataColumn
A column with exactly the provided properties at exactly the provided position.
Exceptions
ExceptionCondition
ArgumentOutOfRangeException If columnNumber is either less than 0 or greater than ColumnCount
InvalidOperationException If the provided type is not a subclass of DataColumn or is an abstract type. or A column with the same name already exists to the left of the provided position.
See Also