CustomPaletteWebEventArgs.Palette Property
Gets or sets a palette used to color dashboard item elements.
Namespace: DevExpress.DashboardWeb
Assembly: DevExpress.Dashboard.v26.1.Web.dll
Declaration
Property Value
| Type | Description |
|---|---|
| DashboardPalette | A DashboardPalette object that specifies a palette used to color dashboard item elements. |
Remarks
DevExpress Dashboard uses colors from predefined palettes. Use the DashboardPalette static read-only fields to get predefined dashboard palettes.
On the server, you can use the following events to create your own palette with custom colors:
Custom Palette for a Specific Dashboard
The following example illustrates how to apply a custom palette to a dashboard. Create and initialize the DashboardPalette class instance and assign the resulting object to the e.Palette event parameter:
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using System.Drawing;
void Default_CustomPalette(object sender, CustomPaletteWebEventArgs e) {
if (e.DashboardId == "SalesByCategory") {
// Create a new custom palette.
List<DashboardPaletteItem> paletteItems = new List<DashboardPaletteItem>();
paletteItems.Add(new DashboardPaletteItem(Color.LightBlue));
paletteItems.Add(new DashboardPaletteItem(Color.Aquamarine));
paletteItems.Add(new DashboardPaletteItem(Color.SkyBlue,DevExpress.Drawing.DXHatchStyle.DiagonalCross));
paletteItems.Add(new DashboardPaletteItem(Color.LightCoral));
paletteItems.Add(new DashboardPaletteItem(Color.Tomato));
paletteItems.Add(new DashboardPaletteItem(Color.IndianRed));
paletteItems.Add(new DashboardPaletteItem(Color.Violet, DevExpress.Drawing.DXHatchStyle.Sphere, DevExpress.Drawing.DXDashStyle.DashDotDot));
paletteItems.Add(new DashboardPaletteItem(Color.Plum));
paletteItems.Add(new DashboardPaletteItem(Color.MediumOrchid));
// Assign a newly created custom palette to the Web Dashboard.
e.Palette = new DashboardPalette(paletteItems);
}
}
The image below displays the resulting palette:

Custom Colors for a Predefined Dashboard Palette
Use the e.PaletteName property to replace the colors of a specific built-in palette.
The following code substitutes the Bright palette colors with a custom set:
using DevExpress.DashboardCommon;
using DevExpress.DashboardWeb;
using System.Drawing;
void Default_CustomPalette(object sender, CustomPaletteWebEventArgs e) {
if (e.PaletteName == nameof(DashboardPalette.Bright)) {
// Create a new custom palette.
List<DashboardPaletteItem> paletteItems = new List<DashboardPaletteItem>();
paletteItems.Add(new DashboardPaletteItem(Color.LightBlue));
paletteItems.Add(new DashboardPaletteItem(Color.Aquamarine));
paletteItems.Add(new DashboardPaletteItem(Color.SkyBlue));
paletteItems.Add(new DashboardPaletteItem(Color.LightCoral));
paletteItems.Add(new DashboardPaletteItem(Color.Tomato));
paletteItems.Add(new DashboardPaletteItem(Color.IndianRed));
paletteItems.Add(new DashboardPaletteItem(Color.Violet));
paletteItems.Add(new DashboardPaletteItem(Color.Plum, DevExpress.Drawing.DXHatchStyle.Sphere));
paletteItems.Add(new DashboardPaletteItem(Color.MediumOrchid));
// Assign a newly created custom palette to the Web Dashboard.
e.Palette = new DashboardPalette(paletteItems);
}
}
The image below displays the result:

Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Palette property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.