4 Answers, 1 is accepted
0
Accepted
Hi Mattias,
This one should be easy. You need to attach to the OnClientColorChange or OnClientColorSelecting event of RadColorPicker and obtain the selected color. After that set it as a value to the editor.get_contentArea().style.backgroundColor = "color value returned by RadColorPicker".
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
This one should be easy. You need to attach to the OnClientColorChange or OnClientColorSelecting event of RadColorPicker and obtain the selected color. After that set it as a value to the editor.get_contentArea().style.backgroundColor = "color value returned by RadColorPicker".
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mattias
Top achievements
Rank 1
answered on 10 Dec 2008, 04:07 PM
Got it! :)
<telerik:RadColorPicker ID="radColorPickerBackgroundColor" runat="server" |
Preset="Default" OnClientColorChange="HandleClientValueChange"> |
</telerik:RadColorPicker> |
<telerik:RadEditor ID="radEditorText" Runat="server" Height="334px" Width="221px"> |
<CssFiles> |
<telerik:EditorCssFile Value="/Style/PublicStyle.css" /> |
</CssFiles> |
</telerik:EditorToolGroup> |
</telerik:RadEditor> |
<script type="text/javascript"> |
function HandleClientValueChange(sender, eventArgs) { |
var editor = $find("<%=radEditorText.ClientID%>"); |
var style = editor.get_contentArea().style; |
style.backgroundColor = sender.get_selectedColor(); |
} |
</script> |
0
Mattias
Top achievements
Rank 1
answered on 11 Dec 2008, 08:26 AM
Hmm, how can I set it code behind?
Have tried with:
radEditorText.Style.Add(HtmlTextWriterStyle.BackgroundColor, CurrentBanner.BackgroundColor);
and
radEditorText.BackColor = ColorTranslator.FromHtml(CurrentBanner.BackgroundColor);
but it seems to have no effect!
Have tried with:
radEditorText.Style.Add(HtmlTextWriterStyle.BackgroundColor, CurrentBanner.BackgroundColor);
and
radEditorText.BackColor = ColorTranslator.FromHtml(CurrentBanner.BackgroundColor);
but it seems to have no effect!
0
Hi Mattias,
Currently, you can use only the client-side solution, because the server BackColor property is inherited from the base control of RadEditor and it is not yet implemented. If you want to have a server-side solution, you could import the javascript code from the codebehind using the ScriptManager.RegisterClientScriptBlock() server method.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Currently, you can use only the client-side solution, because the server BackColor property is inherited from the base control of RadEditor and it is not yet implemented. If you want to have a server-side solution, you could import the javascript code from the codebehind using the ScriptManager.RegisterClientScriptBlock() server method.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.