Skip to main content
All docs
V26.1
  • CustomPaletteWebEventArgs.PaletteName Property

    Gets the name of the selected palette.

    Namespace: DevExpress.DashboardWeb

    Assembly: DevExpress.Dashboard.v26.1.Web.dll

    Declaration

    public string PaletteName { get; }

    Property Value

    Type Description
    String

    A palette name that maps to a registered dashboard palette.

    Remarks

    Use this property to determine which palette name is currently associated with the dashboard.

    The following code replaces the colors of the predefined Bright palette with a custom set:

    using DevExpress.DashboardCommon;
    using DevExpress.DashboardWeb;
    using System.Collections.Generic;
    using System.Drawing;
    
    protected void ASPxDashboard1_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 the custom palette to the Web Dashboard.
            e.Palette = new DashboardPalette(paletteItems);
        }
    }
    
    See Also