If you bind the SelectedIndex or the SelectedItem properties to your ViewModel and change them from code, the UI will not be updated. This is both reproducible in ColorPicker, ColorSelector and ColorPaletteView.
The borders around the color visuals (RadColorPaletteViewItem) in the palette view are shown at the wrong visuals when the MainPaletteItemsSource and MainPaletteColumnsCount properties are changed at runtime.
To work this around, re-adjust the PositionState values of the RadColorPaletteViewItems. For example:
private void ChangePalette()
{
this.colorSelector.MainPaletteItemsSource = MyGetSourceMethod();
this.colorSelector.MainPaletteColumnsCount = 10;
UpdatePaletteItems();
}
private void UpdatePaletteItems()
{
var mainPalette = colorSelector.ChildrenOfType<RadColorPaletteView>().First(x => x.Name == "MainPalette");
var paletteItems = mainPalette.ChildrenOfType<RadColorPaletteViewItem>();
var paletteItemsCount = paletteItems.Count();
var columnsCount = mainPalette.PaletteColumnsCount;
var orientation = mainPalette.PaletteOrientation;
for (int i = 0; i < paletteItemsCount; i++)
{
var paletteItem = paletteItems.ElementAt(i);
if ((columnsCount == paletteItemsCount) || (paletteItemsCount / columnsCount == 0))
{
paletteItem.PositionState = PositionState.Single;
return;
}
if (orientation == Orientation.Horizontal)
{
if (i < columnsCount)
{
paletteItem.PositionState = PositionState.Top;
}
else if (i > (paletteItemsCount - columnsCount - 1))
{
paletteItem.PositionState = PositionState.Bottom;
}
else
{
paletteItem.PositionState = PositionState.Middle;
}
}
else
{
if (i % (paletteItemsCount / columnsCount) == 0)
{
paletteItem.PositionState = PositionState.Top;
}
else if (((i + 1) % (paletteItemsCount / columnsCount)) == 0)
{
paletteItem.PositionState = PositionState.Bottom;
}
else
{
paletteItem.PositionState = PositionState.Middle;
}
}
}
}
A design time error occurs when the control have a custom style based on the default RadColorPickerStyle. This is reproducible only if the project references NoXaml assemblies and it uses the resource dictionaries with the themes locally (the files are copied in the project and then merged in the Resources). The error is the following: 'This feature requires service 'Microsoft.Windows.Design.Services.ValueTranslationService' to be present, but it could not be located. ' As a workaround you can merge the resources directly from the .dll file of the theme as demonstrated in the Setting a Theme help article. http://www.telerik.com/help/wpf/styling-apperance-implicit-styles-overview.html Available in LIB version: 2015.1.0604
Setting the RadColorPicker's / RadColorSelector's PaletteItemsTemplate has no effect in RecentColorsPaletteView. This is the section which appears when the RecentColors funtionality in the ColorPicker is active. Available in LIB version: 2015.1.0309
If you bind the SelectedIndex or the SelectedItem properties to your ViewModel and change them from code, the UI will not be updated. This is both reproducible in ColorPicker, ColorSelector and ColorPaletteView. The issue is fixed in Q2 2014 Release.
RecentColors functionality doesn't work when you set RecentColorsItemsSource. The recent colors are not shown at all but they should be. When using this property the user should be able to customize the recent colors functionality on his own. Showing the recent colors is a must when setting non-empty colletion via RecentColorsItemSource.
A NullReferenceException is thrown when the drop down part of the ColorPicker control is opened initially. For example, this can happen if the IsDropDownOpen property is set to True in XAML.
This bug is actually related to the RadSplitButton used inside the ControlTemplate of the ColorPicker. It is reproducible also if you use RadSplitButton only.
The issue reproduces with the Office2016 and Office2019 themes, but probably appears also in other themes (Green and later). The error is gone if you use an older theme like the default Office_Black.
To work this around, set the IsDropDownOpen property of the RadColorPicker in its Loaded event handler.
private void RadColorPicker_Loaded(object sender, RoutedEventArgs e)
{
var picker = (RadColorPicker)sender;
picker.IsDropDownOpen = true;
}
Implicit styles are set via refering included XAML files. Set Style targetting RadColorPicker and BasedOn RadColorPickerStyle. Set this stye in App.xaml after the resource dictionaries. In desinger - MS exception is thrown "This feature requires Microsoft.Windows.Design.Sevices.valueTranslationService". Note that this is only reproducible when xaml fiels are included in the project. This is NOT reproducible when you reference xaml files from the style dll (for example Telerik.Windows.Themes.Office_Black). The fix will be available in our official release Q2 2015 SP.
Available in LIB version: 2015.2.713
Set SelectedColor = Red in XAML or code behind or via databinding. Open the color Picker - the red color in Standard Colors is NOT selected but it should be. A possible workaround could be: <Style TargetType="telerik:RadColorPaletteView"> <Setter Property="SelectedItem" Value="{Binding MediaColor, Mode=OneWay, RelativeSource={RelativeSource AncestorType=telerik:RadColorSelector}}" /> </Style> Available in LIB version: 2014.3.1208
You can't customize ButtonPart ot TogglePart of SplitButton in ColorPicker as SplitButtonStyle doesn't get applied with this property.