Click or drag to resize

EditCommandsMapOrCreateDataColumnsToRows Method

Maps each data column of the source table to a corresponding data row (!) 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 data of destination columns and source rows are 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[] MapOrCreateDataColumnsToRows(
	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 row (!) in the source table with the same index.
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 row of the source table, and so forth. If there is a column selection, the first selected column of the destination table matches the first row of the source table, the second selected column of the destination table matches the second row of the source table. If there are more source rows 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. The type of the newly created columns in the destination table is the same as the first column of the source table in this case.
See Also