Skip to main content

Palettes.GetPalette(String) Method

Returns a palette by its name.

Namespace: DevExpress.XtraTreeMap

Assembly: DevExpress.XtraTreeMap.v23.2.dll

NuGet Package: DevExpress.TreeMap

Declaration

public static Palette GetPalette(
    string name
)

Parameters

Name Type Description
name String

The palette name.

Returns

Type Description
Palette

The palette with the name you pass. Returns null (Nothing in Visual Basic) if a palette with the given name is not found.

Example

This example shows how to use the ListBoxControl to display a list of predefined palettes for a TreeMap.

using DevExpress.XtraTreeMap;
using System;
using System.Windows.Forms;
//...
private void OnFormLoad(object sender, EventArgs e) {
    listBoxControl1.DataSource = Palettes.GetNames();
    listBoxControl1.SelectedValueChanged += OnSelectedValueChanged;
}
private void OnSelectedValueChanged(object sender, EventArgs e) {
    TreeMapPaletteColorizerBase paletteColorizer = (TreeMapPaletteColorizerBase)treeMap1.Colorizer;
    paletteColorizer.Palette = Palettes.GetPalette(listBoxControl1.SelectedValue.ToString());
}

Related TreeMap API:

  • Palettes.GetNames - Returns a list of built-in palettes’ names.
  • Palettes.GetPalette - Returns a palette by its name.
See Also