Skip to main content
A newer version of this page is available. .
All docs
V21.2
.NET Framework 4.5.2+
Row

WorkbookColorPalette.CopyFrom(WorkbookColorPalette) Method

Copies colors from the specified palette to the current palette.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v21.2.Core.dll

Declaration

void CopyFrom(
    WorkbookColorPalette other
)

Parameters

Name Type Description
other WorkbookColorPalette

A workbook palette that contains colors to copy.

Exceptions

Type Description
ArgumentException

Occurs if other parameter is null (Nothing in Visual Basic).

Remarks

The following code example demonstrates how to copy a color palette from one workbook to another:

using DevExpress.Spreadsheet;
// ...
using (Workbook sourceWorkbook = new Workbook())
using (Workbook targetWorkbook = new Workbook())
{
    targetWorkbook.LoadDocument("Book1.xlsx");
    sourceWorkbook.LoadDocument("Book2.xlsx");
    targetWorkbook.ColorPalette.CopyFrom(sourceWorkbook.ColorPalette);
}
See Also