Click or drag to resize

EditCommandsMapOrCreateDataColumns Method

Maps each data column of the source table to a corresponding data columns of the destination table. The matching is based on the index (order) and on the currently selected columns of the destination table. Attention: The match here does not mean that the two columns are data compatible to each other!

Namespace: Altaxo.Worksheet.Commands
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
protected static DataColumn[] MapOrCreateDataColumns(
	DataTable desttable,
	IAscendingIntegerCollection selectedDestColumns,
	DataTable sourcetable
)

Parameters

desttable  DataTable
The destination table.
selectedDestColumns  IAscendingIntegerCollection
The currently selected columns of the destination table.
sourcetable  DataTable
The source table.

Return Value

DataColumn
An array of columns. Each column of the array is a data column in the destination table, which matches (by index) the data column in the source table.
Remarks
1.) Since the returned columns are part of the DataColumns collection of the destination table, you must not use these for inserting i.e. in other tables. 2.) The match is based on the index and the selected columns of the destination table. The rules are as follows: if there is no selection, the first column of the destination table matches the first column of the source table, and so forth. If there is a column selection, the first selected column of the destination table matches the first column of the source table, the second selected column of the destination table matches the second column of the source table. If more source columns than selected columns in the destination table exists, the match is done 1:1 after the last selected column of the destination table. If there is no further column in the destination table to match, new columns are created in the destination table.
See Also