Click or drag to resize

DataColumnCollectionEnsureExistenceAtPositionStrictlyTDataCol(Int32, String, 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 TDataCol EnsureExistenceAtPositionStrictly<TDataCol>(
	int columnNumber,
	string columnName,
	ColumnKind columnKind,
	int groupNumber
)
where TDataCol : DataColumn

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.
columnKind  ColumnKind
Kind of the column.
groupNumber  Int32
The group number of the column.

Type Parameters

TDataCol
The type of the data column. Has to be a type derived from DataColumn.

Return Value

TDataCol
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