DashboardConfigurator.CustomPalette Event
Allows you to substitute a dashboard palette used to paint dashboard item elements.
Namespace: DevExpress.DashboardWeb
Assembly: DevExpress.Dashboard.v26.1.Web.dll
Declaration
Event Data
The CustomPalette event's data class is CustomPaletteWebEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| DashboardId | Gets a dashboard identifier. |
| Palette | Gets or sets a palette used to color dashboard item elements. |
| PaletteName | Gets the name of the selected palette. |
Remarks
Tip
For information on how to use the DashboardConfigurator‘s API, see the following topic: Server-Side API Overview.
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:
- ASPxDashboard.CustomPalette
DashboardConfigurator.CustomPalette
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 CustomPalette event.
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.