This is a migrated thread and some comments may be shown as answers.

Module Lead

1 Answer 111 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Randeep
Top achievements
Rank 1
Randeep asked on 01 Jul 2015, 06:36 AM

I am looking for maintaining the same recent color list for all the RadColorPicker instances which we have in application. e. g. if user creates a custom color from one colorpicker (and colorEditor) control, user doesn't have to do the same for another color pickers. User should see the same color in recent colors for the all the color pickers.

I am trying to figure out, how to implement it. I see the property RecentColorsItemsSource, which could be of use here , but then, I am not able to get it working. I am trying to set sample colors in the code behind like this: 

 

void radColorPicker_Loaded(object sender, RoutedEventArgs e)
        {
            radColorPicker.RecentColorsItemsSource = new List<Color> { Colors.Red, Colors.Pink };
        }

 

but with this code I am getting this error:

 "Object reference not set to an instance of an object."}

   at Telerik.Windows.Controls.RadColorSelector.BindRecentColorsPalette()
   at Telerik.Windows.Controls.RadColorSelector.BindXamlElements()
   at Telerik.Windows.Controls.RadColorSelector.OnApplyTemplate()
   at System.Windows.FrameworkElement.ApplyTemplate()
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint)
   at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Control.MeasureOverride(Size constraint)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Border.MeasureOverride(Size constr

 Some help here would be appreciable.

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 03 Jul 2015, 10:25 AM
Hi Randeep,

Thank you for reporting this issue. We can confirm this is a bug and therefore I logged it in our Feedback Portal where you can track its progress. I have also updated your Telerik points as a small appreciation for your cooperation.
 
In the meantime, as a workaround you can change the List with ObservableCollection:
private void xColorPicker_Loaded(object sender, RoutedEventArgs e)
{
 radColorPicker.RecentColorsItemsSource = new ObservableCollection<Color> { Colors.Red, Colors.Pink };
}

Please excuse us for any inconvenience caused.

Regards,
Milena
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ColorPicker
Asked by
Randeep
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or