Enable/Disable RadColorPicker instance

10 posts, 0 answers
  1. GAULTIER
    GAULTIER avatar
    1 posts
    Member since:
    Jul 2008

    Posted 11 Jul 2008 Link to this post

    Hello,

    I am working with this component in my page and i need to disable the javascript action (which open picker popup) when the user is on readonly on the page.

    My code in aspx is : 

    <

    Prometheus:RadColorPicker runat="server" ID="radCpMainBackgroundColor" ShowIcon="true" Preset="default" ShowEmptyColor="false" SelectedColor="#000000" OnClientColorChange="HandleMainBackgroundColorChange" />

    And the code behind which is not working is  : 

    radCpMainBackgroundColor.Enabled =

    false;

    How can i disable the control from code behind ?

    Best regards,
    Nicolas

  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 Jul 2008 Link to this post

    Hello Nicolas,


    Indeed, this is the proper way to disable the RadColorPicker. Please make sure that you are using a recent version of RadControls for ASP.NET AJAX and you should not experience this problem.

    <script runat="server"
     
        protected void Button1_Click(object sender, EventArgs e) 
        { 
            radCpMainBackgroundColor.Enabled = false
        } 
    </script> 
     
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server"
            </asp:ScriptManager> 
     
     <telerik:RadColorPicker runat="server" ID="radCpMainBackgroundColor" ShowIcon="true" Preset="default" ShowEmptyColor="false" SelectedColor="#000000" /> 
            <asp:Button ID="Button1" runat="server" Text="Disable the colorpicker" OnClick="Button1_Click" /> 



    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. abhishek
    abhishek avatar
    3 posts
    Member since:
    Dec 2007

    Posted 25 Nov 2008 Link to this post

    Hi Georgi,

    To fix this issue we have downloaded following exe for new version :-
    RadControls_for_ASP.NET_AJAX_2008_2_1001_dev.exe
    It resolve the issue but we are getting the message that it is a trial version,please use developer version.
    Currently we are using licensed 2007_Q3 version of telrik control.
    Is it require to get new license ???
    Please suggest ,in case no new license is required then provide the link from where we can get developer version of color picker control.

    Please reply ASAP as we are in the middle of our UT.

    Regards
    Abishek.
  5. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 25 Nov 2008 Link to this post

    Hi Abishek,
    You have downloaded the trial version of the RadControls for ASP.NET AJAX instead of the licensed version. Please go to your account->Purchases & Downloads->RadControls for ASP.NET AJAX->Download Tab. You can use the instructions from our Updating RadControls for ASP.NET to another version or license online article to upgrade the controls to the next version(Q3 2008).

    All the best,
    Tsvetie
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Mariyam Khambhati
    Mariyam Khambhati avatar
    20 posts
    Member since:
    Apr 2008

    Posted 07 Jan 2009 Link to this post

    I am also facing the same problem.
    I am unable to disable the colorpicker on clientside using the foolowing code
    RadColorPicker1.enable = false;

    I am using the latest version of the telerik and my version no is 2008.3.1105.35
    Please let me know how to resolve this issue.
  7. Mariyam Khambhati
    Mariyam Khambhati avatar
    20 posts
    Member since:
    Apr 2008

    Posted 07 Jan 2009 Link to this post

    I mean using RadColorPicker1.Enabled = false
  8. Mariyam Khambhati
    Mariyam Khambhati avatar
    20 posts
    Member since:
    Apr 2008

    Posted 07 Jan 2009 Link to this post

    It is really very urgent. Could teleric guys reply back soon?
  9. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 08 Jan 2009 Link to this post

    Hello Mariyam Khambhati,
    The code you have provided and mention that it does not work is server code:
    RadColorPicker1.Enabled = false 

    Do you mean that the server code does not work?

    In order to disable the color picker on the client - you have to get a reference to the RadColorPicker client object and use its set_enabled client method. Please refer to our documentation for additional information.

    Best wishes,
    Tsvetie
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. Mariyam Khambhati
    Mariyam Khambhati avatar
    20 posts
    Member since:
    Apr 2008

    Posted 10 Jan 2009 Link to this post

    Hi ,

    I am using the following code on Client side.

     

    var radColorPicker = $find('<%= RadColorPicker1.ClientID %>');

     

    radColorPicker._enabled =

    false;

    I thingk by doing this, it should disable the Color picker. But it is not working in that way 
    i want to hide the color picker completely(not visible)  on some condition  and display the color picker on some condtions on client side. Please provide me an example or complete code to do so.
    It is very urgent.

    and one more thing, the following link
    http://www.telerik.com/community/forums/aspnet-ajax/colorpicker/enabling-disabling-radcolorpicker-in-javascript.aspx
    say that there is an issue in enbaling and disabling Color picker and will be resolved in next release. if so please provide me some workaround to hide and display color picker.

     

  11. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 13 Jan 2009 Link to this post

    Hello Mariyam Khambhati,
    The thread you mention was posted on Oct 13, 2008. That is why, the problem discussed in it is fixed in the latest version of the suite and you do not need a workaround.

    Regarding your question about disabling the RadColorPicker on the client - as I mentioned in my previous post, you have to use the public setter for this property in order to disable the control and not the private _enabled field:
    radColorPicker.set_enabled(false);

    However, disabling the control will not hide it, it will only disable it. In case you want to hide the RadColorPicker, you can set "visibility:hidden", "display:none" or "position:absolute;top:-9999;left-9999;" depending on the expected result for its outermost element. For example:
    radColorPicker.get_element().style.visibility = 'hidden';

    Regards,
    Tsvetie
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017