Back to Devexpress

WorkbookColorPalette.Reset() Method

officefileapi-devexpress-dot-spreadsheet-dot-workbookcolorpalette.md

latest1.7 KB
Original Source

WorkbookColorPalette.Reset() Method

Resets custom palette colors to default colors.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
void Reset()
vb
Sub Reset

Remarks

The following example demonstrates how to reset custom colors in a workbook palette to default colors. Use the WorkbookColorPalette.IsCustom property to check whether the palette contains custom colors.

csharp
using DevExpress.Spreadsheet;
// ...
using (Workbook workbook = new Workbook())
{
    workbook.LoadDocument("Book1.xlsx");
    // ...
    if (workbook.ColorPalette.IsCustom)
        workbook.ColorPalette.Reset();
}
vb
Imports DevExpress.Spreadsheet
' ...

Using workbook As New Workbook()
    workbook.LoadDocument("Book1.xlsx")
    ' ...
    If workbook.ColorPalette.IsCustom Then
        workbook.ColorPalette.Reset()
    End If
End Using

See Also

WorkbookColorPalette Interface

WorkbookColorPalette Members

DevExpress.Spreadsheet Namespace