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

Color Picker Issue in Q3 2009

4 Answers 44 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Albert Shenker asked on 11 Dec 2009, 08:19 PM
I have a color picker and want to define a discrete set of colors which are to be shown. My declaration is below. Since upgrading to the Q3 2009 controls, this isn't working. My color picker shows the discrete set colors along with what appears to be the entire default color palette. The color picker is within an ajaxified container, though I don't know if that is the problem, and it certainly wasn't before the upgrade.

<telerik:RadColorPicker   
                                                                runat="server"   
                                                                ID="rcpBackground"   
                                                                Columns="12"   
                                                                Width="350" 
                                                                ShowEmptyColor="false" 
                                                                ShowIcon="True"   
                                                                AutoPostBack="True" 
                                                                Skin="Hay">  
                                                    <Items> 
                                                        <telerik:ColorPickerItem Title="Red" Value="#FF0000" /> 
                                                        <telerik:ColorPickerItem Title="Orange" Value="#FF9900" /> 
                                                        <telerik:ColorPickerItem Title="Yellow" Value="#FFFF99" /> 
                                                        <telerik:ColorPickerItem Title="Light Green" Value="#86D986" /> 
                                                        <telerik:ColorPickerItem Title="Green" Value="#00CC00" /> 
                                                        <telerik:ColorPickerItem Title="Dark Green" Value="#006600" /> 
                                                        <telerik:ColorPickerItem Title="Light Blue" Value="#7AB8FF" /> 
                                                        <telerik:ColorPickerItem Title="Blue" Value="#0000CC" /> 
                                                        <telerik:ColorPickerItem Title="Dark Blue" Value="#000066" /> 
                                                        <telerik:ColorPickerItem Title="Brown" Value="#663300" /> 
                                                        <telerik:ColorPickerItem Title="Gray" Value="#C8C8C8" /> 
                                                        <telerik:ColorPickerItem Title="Black" Value="#000000" /> 
                                                    </Items> 
                                                </telerik:RadColorPicker> 

4 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 14 Dec 2009, 08:40 AM
Hello Albert Shenker,
I suppose the problem is that you can see not only the colors you defined in the color picker palette, but the colors from the Default preset as well. The problem is that you have not set Preset="None":
<telerik:RadColorPicker runat="server" ID="rcpBackground" Columns="12" Width="350"
    ShowEmptyColor="false" ShowIcon="True" AutoPostBack="True" Skin="Hay"
    Preset="None">

There was a problem with handling the Preset property when its is not set explicitly in the previous versions of RadColorPicker for ASP.NET AJAX that lead to the result you got. As this problem is fixed in Q3 2009, you have not set Preset=None and the default value of the Preset property is Default, you get more colors than you expect. In order for the color picker to display only the colors you defined, please set Preset=None.

All the best,
Tsvetie
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
Matt
Top achievements
Rank 1
answered on 05 Feb 2010, 06:00 PM
    protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!Page.IsPostBack)  
        {  
            cp.Items.AddRange(KPI.ChartColors.GetColorsForColorPicker());  
            cp.Columns = 6;  
        }  
    } 
I am having the same issue but setting the preset to 0 does not help.

Whenever the page comes up, there is a full set of colors before the colors that i am adding.

    <telerik:RadColorPicker ID="cp" runat="server" Skin="WebBlue" Preset="None" 
                    ShowIcon="true"   
                    ShowEmptyColor="false"   
                    PreviewColor="false">  
    </telerik:RadColorPicker> 

The color picker is in a user control if that matters.

Thanks,
Matt
0
Tsvetie
Telerik team
answered on 10 Feb 2010, 03:27 PM
Hi Matt,
I tried to reproduce the problem you have, but to no avail - please, find my test page attached. As you have not specified which version of the Telerik.Web.UI assembly you use, I tested with the latest version - 2009.3.1314.

In case the attached code does not help you, please open a new support ticket and send us a simple running project that demonstrates the problem you have.

Sincerely yours,
Tsvetie
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Matt
Top achievements
Rank 1
answered on 10 Feb 2010, 04:32 PM
My apologies.  It turns out i was not using my wrapper control for all the color picker controls, so some of them were not having the colors set properly.

Thanks for your reply.

Matt
Tags
ColorPicker
Asked by
Albert Shenker
Top achievements
Rank 1
Veteran
Iron
Answers by
Tsvetie
Telerik team
Matt
Top achievements
Rank 1
Share this question
or