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

SelectedColor doesn't update UI

7 Answers 175 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Mark
Top achievements
Rank 1
Mark asked on 18 Aug 2009, 11:18 PM
I've tried setting SelectedColor via the exposed property, and also by using SetValue and passing the dependency property directly, but neither one actually updates the RadColorSelector UI to put the "highlight" box around the color. Am I missing something here? There has to be a way to do this programmatically, right?

7 Answers, 1 is accepted

Sort by
0
Accepted
Valentin.Stoychev
Telerik team
answered on 20 Aug 2009, 07:30 AM
Hello Mark,

Thank you for reporting this. We are aware of the problem and will address it with the internal build next week.

Setting the SelectedColor is the correct way to do it.

Best wishes,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Eber
Top achievements
Rank 1
answered on 24 Nov 2009, 11:38 AM
Hello,
This problem has been solved?
I
downloaded the file RadControls_for_Silverlight_2009_3_1120_Dev.zip and apparently the problem is still there ...
Thank's
0
Bobi
Telerik team
answered on 24 Nov 2009, 11:44 AM
Hi Eber,

We deeply apologize for the caused inconvenience.
We are working on this issue. The problem  will be fixed for  the next official Q1 release.

All the best,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Terry
Top achievements
Rank 1
answered on 12 Aug 2010, 10:03 PM
The color picker does not appear to be a high priority item at Telerik.  This issue is a year old.  And being able to set the no-color color has been an issue for a few months now.  (This is necessary so I can tell whether the user is clicking Transparent or black, which both produce the same SelectedColor.)  The standard color for transparency is Colors.Transparent = #00FFFFFF.  Just returning that would be helpful.

I have this SelectedColor having no effect on the UI issue as well.  I need to set the selected color to the color of the current object, but it's the color last selected in the color picker.

Also, is it possible to have the SelectedColorChanged event fire when the user clicks the currently selected color.  I'm getting complaints from customers saying the color picker does not work.  They are repeatedly clicking on the selected color and saying the picker is hung.  When the user clicks on a color, the color picker should go away, even if it is the currently selected color.

So I have 3 items that I would like help with.
1. Allow us to set No-color color, or return the standard Colors.Transparent = #00FFFFFF, or any other color with zero opacity.
2. Reflect SelectedColor change in the picker.
3. Option to treat clicking on the selected color the same as a click on any other color.  I.e. close picker and fire the SelectedColorChanged event.

With all the great products and wonderful support from Telerik, the color picker stands out as a half-baked, poorly supported control. 
I hope these issues will be resolved soon.

Thanks,

Terry
0
Viktor Tsvetkov
Telerik team
answered on 13 Aug 2010, 01:13 PM
Hi Terry,

We deeply apologize for the caused inconvenience.

1. With our service pack the RadColorPicker comes with a new property called AutomaticColor which can be set in order to change the NoColor field.
2. This is already fixed.
3.  Could you please examine the attached sample project. When you click the already selected color, the picker closes and this is expected, but SelectedColorChanged is not fired because this is the internal logic. Could you please tell me why do you need such behavior?

Best wishes,
Viktor Tsvetkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Terry
Top achievements
Rank 1
answered on 13 Aug 2010, 09:19 PM
Thanks, Viktor, yesterday's update is progress.

I was invoking the RadColorSelector via a button click and that was part of my problems.  When I updated to the 8/12/2010 release and changed the logic to use a RadColorPicker instead, things got better.  However, I am experiencing a problem with AutomaticColor.

I set it in the XAML (it's inside a ribbon group) as follows:
<telerikRibbonBar:RadButtonGroup HorizontalAlignment="Center" Margin="3">
    <telerikInput:RadColorPicker x:Name="FillColor_Selector" AutomaticColor="#00FFFFFF" Loaded="RadColorSelector_Loaded" 
            SelectedColorChanged="FillColor_Selector_SelectedColorChanged" DropDownOpened="ColorPicker_DropDownOpened"
            Click="Color_Selector_Click" />
</telerikRibbonBar:RadButtonGroup>
This doesn't work, so I set the AutomaticColor in each dropdown event:
private void ColorPicker_DropDownOpened( object sender, EventArgs e )
{
    RadColorPicker sel = sender as RadColorPicker;
    sel.NoColorText = "Transparent";
    sel.MainPaletteHeaderText = "Standard Colors";
    sel.StandardPaletteHeaderText = "Custom Colors";
    sel.MainPaletteColumnsCount = 10;
    GetStandardColors();            // populate HeaderColors & MainColors
    sel.HeaderPaletteItemsSource = HeaderColors;
    sel.MainPaletteItemsSource = MainColors;
    // if you don't do the following, the picker doesn't get updated with custom colors added since last open
    sel.StandardPaletteItemsSource = new Collection<Color>(); 
    sel.UpdateLayout();
    sel.StandardPaletteItemsSource = CustomColors;
    sel.AutomaticColor = Colors.Transparent;
    sel.UpdateLayout();
}
There are two problems here:
1. Note that I have to set the StandardPaletteItemsSource to an empty array and then set it back in order to pick up additional CustomColors added since the last time the dropdown event occurred.  If I remove the first two lines after the comment, I do not see additional colors added to the CustomColors collection.  The picker is caching the previous contents of the collection.  This is just an inconvenience, as I now have a workaround, but I thought I would report it anyway.
2. The real problem is that the AutomaticColor is updated correctly if you set a breakpoint, but in the SelectionColorChaged event, the resulting color is #FF000000, not #00FFFFFF as I set it (Colors.Transparent).  Here is the event code:
private void FillColor_Selector_SelectedColorChanged( object sender, EventArgs e )
{
    RadColorPicker selector = sender as RadColorPicker;
    Color color = selector.SelectedColor;
    txtSelectedFillColor.Text = color.ToString();
    SetFillColor();
}

selector.SelectedColor is back to #FF000000 no matter what I set it to in the XAML and the dropdown event.  The example you provided does work for me, but I want the user to just click on the picker dropdown to select the color.
3. The "A" icon showing the selected color is very cool when you are selecting a text color, but it's confusing for a fill color where the user is used to seeing a paint bucket icon (also showing the current fill color).  Is there a fill icon available as well?  it would be easy to use my own paint bucket icon, but it would not reflect the current color.

I am attaching a screen shot to show you what the UI looks like.  With the right textbox selected, I pick the Transparent color and end up with a black background instead.

Thanks,

Terry


0
Viktor Tsvetkov
Telerik team
answered on 17 Aug 2010, 09:08 AM
Hi Terry,

About the first problem with StandardPaletteItemsSource could you please send me your sample project, so I will be able to better investigate it.
There was a problem with the AutomaticColor property, but with our latest internal build everything is fine and it could be set directly in XAML.
If you want to set another icon instead of "A" you have to set a custom style for the ColorButtonStyle property of the RadColorPicker. You can see how it is done in this example.

Kind regards,
Viktor Tsvetkov
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
ColorPicker
Asked by
Mark
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Eber
Top achievements
Rank 1
Bobi
Telerik team
Terry
Top achievements
Rank 1
Viktor Tsvetkov
Telerik team
Share this question
or