DataGridColumnAdder DuplicateGridView Method CleanCode C# Libraries v1.2.03 API
Duplicates a bound or unbound OnlineDataGridView in an unbound DataGridView.

Namespace: CleanCode.Forms
Assembly: CleanCode (in CleanCode.dll) Version: 1.2.3.0 (1.2.03)
Syntax

public static void DuplicateGridView(
	DataGridView sourceDGV,
	DataGridView destDGV
)
Remarks

This method creates a copy of a DataGridView, and replacing the source DataGridView on its parent form. The source DataGridView is simply hidden; it is not deleted. The set of properties that are duplicated are taken from the suggestions at the unbound datagrid walk-through at Online Creating an Unbound Windows Forms DataGridView Control. While one could actually just add columns to a bound DataGridView and fill in the data there, that approach has (at least) two drawbacks. First, one could not sort on the new columns. Second, sorting on one of the original columns drops all the data in the new columns.
See Also