New to Telerik UI for Silverlight? Download free 30-day trial

Getting Started

This article will help you get started with the Telerik RadColorEditor control

Assembly References

In order to use the RadColorEditor in your projects you have to add references to the following assemblies:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.Input

You can find more info here.

Adding RadColorEditor to the Project

You can add RadColorEditor manually by writing the XAML code in Example 1. You can also add the control by dragging it from the Visual Studio Toolbox and dropping it over the XAML view.

Example 1: Adding RadColorEditor in XAML

<Grid> 
    <telerik:RadColorEditor x:Name="colorEditor" /> 
</Grid> 

Selection

The RadColorEditor is a control that displays a custom palette from which users can select a single color. The control exposes a SelectedColor property, which is of type Color and is used to store the selected color value.

Example 2: Setting the SelectedColor property

<telerik:RadColorEditor SelectedColor="Red" /> 

Example 2: Setting the SelectedColor property in code behind

RadColorEditor colorEditor = new RadColorEditor(); 
colorEditor.SelectedColor = Colors.Red; 
Dim colorEditor As New RadColorEditor() 
colorEditor.SelectedColor = Colors.Red 

Whenever a color is selected the SelectedColorChanged event is raised:

Example 3: Subscribing to SelectedColorChanged event

<telerik:RadColorEditor x:Name="colorEditor" SelectedColorChanged="colorEditor_SelectedColorChanged " /> 

Example 4: Subscribing to SelectedColorChanged event in code behind

colorEditor.SelectedColorChanged += new EventHandler<ColorChangeEventArgs>(colorEditor_SelectedColorChanged); 
 
private void colorEditor1_SelectedColorChanged(object sender, ColorChangeEventArgs e) 
{ 
   Color selectedColor = e.Color; 
} 
colorEditor.SelectedColorChanged += New EventHandler(Of ColorChangeEventArgs)(colorEditor_SelectedColorChanged) 
 
Private Sub colorEditor1_SelectedColorChanged(ByVal sender As Object, ByVal e As ColorChangeEventArgs) 
    Dim selectedColor As Color = e.Color 
End Sub 

See Also

In this article
Not finding the help you need? Improve this article