Skip to main content
All docs
V24.2
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

WorkbookColorPalette.CopyFrom(WorkbookColorPalette) Method

Copies colors from the specified palette to the current palette.

Namespace: DevExpress.Spreadsheet

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

NuGet Package: DevExpress.Spreadsheet.Core

#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