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

Enable/Disable RadColorPicker instance

9 Answers 175 Views
ColorPicker
This is a migrated thread and some comments may be shown as answers.
GAULTIER
Top achievements
Rank 1
GAULTIER asked on 11 Jul 2008, 07:14 AM
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

9 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Jul 2008, 12:43 PM
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
0
abhishek
Top achievements
Rank 2
answered on 25 Nov 2008, 08:40 AM
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.
0
Tsvetie
Telerik team
answered on 25 Nov 2008, 01:03 PM
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.
0
Mariyam Khambhati
Top achievements
Rank 1
answered on 07 Jan 2009, 09:16 AM
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.
0
Mariyam Khambhati
Top achievements
Rank 1
answered on 07 Jan 2009, 09:17 AM
I mean using RadColorPicker1.Enabled = false
0
Mariyam Khambhati
Top achievements
Rank 1
answered on 08 Jan 2009, 05:06 AM
It is really very urgent. Could teleric guys reply back soon?
0
Tsvetie
Telerik team
answered on 08 Jan 2009, 08:37 AM
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.
0
Mariyam Khambhati
Top achievements
Rank 1
answered on 10 Jan 2009, 09:52 AM
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.

 

0
Tsvetie
Telerik team
answered on 13 Jan 2009, 08:50 AM
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.
Tags
ColorPicker
Asked by
GAULTIER
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
abhishek
Top achievements
Rank 2
Tsvetie
Telerik team
Mariyam Khambhati
Top achievements
Rank 1
Share this question
or