Module Lead

2 posts, 0 answers
  1. Randeep
    Randeep avatar
    3 posts
    Member since:
    Jul 2015

    Posted 01 Jul 2015 Link to this post

    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.

  2. Milena
    Milena avatar
    227 posts

    Posted 03 Jul 2015 Link to this post

    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.

    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
Back to Top