Skip to main content
All docs
V25.1
  • Row

    WorkbookColorPalette.CopyFrom(WorkbookColorPalette) Method

    Copies colors from the specified palette to the current palette.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v25.1.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