Edit this page

Declaration

This article demonstrates how you can declare a RadColorPaletteView and populate it with colors.

XAML Declaration

XAML

<telerik:RadColorPaletteView />

Dynamic creation

C#

RadColorPaletteView colorPaletteView = new RadColorPaletteView();

VB.NET

Dim colorPaletteView As New RadColorPaletteView()

Selection

The SelectedItem property holds the selected color:

XAML

colorPaletteView.SelectedItem = Colors.Red;

Populating

You can use the Palette property of RadColorPaletteView to populate the paletteview with one of the built-in palettes.

XAML

<telerik:RadColorPaletteView Palette="ColorPreset.Office" />

C#

RadColorPaletteView colorPaletteView = new RadColorPaletteView();
colorPaletteView.Palette = ColorPreset.Office;

VB.NET

Dim colorPaletteView As New RadColorPaletteView()
colorPaletteView.Palette = ColorPreset.Office

RadColorPaletteView also allows binding to various data source types through the ItemSource property.

XAML

<telerik:RadColorPaletteView ItemsSource="{Binding Source={StaticResource MyColorList}}" />

C#

RadColorPaletteView colorPaletteView = new RadColorPaletteView();
Collection<Color> colors = new Collection<Color>();
colors.Add(Colors.Red);
colors.Add(Colors.Green);
colors.Add(Colors.Blue);
colorPaletteView.ItemsSource = colors;

VB.NET

Dim colorPaletteView As New RadColorPaletteView()
Dim colors1 As New Collection(Of Color)()
colors1.Add(Colors.Red)
colors1.Add(Colors.Green)
colors1.Add(Colors.Blue)
colorPaletteView.ItemsSource = colors1