Color Picker Issue in Q3 2009

5 posts, 1 answers
  1. Albert Shenker
    Albert Shenker avatar
    551 posts
    Member since:
    Mar 2004

    Posted 11 Dec 2009 Link to this post

    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> 
  2. Answer
    Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 14 Dec 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Matt
    Matt avatar
    13 posts
    Member since:
    Apr 2008

    Posted 05 Feb 2010 Link to this post

        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
  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 10 Feb 2010 Link to this post

    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.
  6. Matt
    Matt avatar
    13 posts
    Member since:
    Apr 2008

    Posted 10 Feb 2010 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017