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
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

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.
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.



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.

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.
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.