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

GridHtmlEditorColumn background colour

2 Answers 44 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Clive Hoggar
Top achievements
Rank 1
Clive Hoggar asked on 31 Oct 2012, 05:37 PM
I am using this editor column, and it is inheriting the page css. This is OK except that I want to over-ride the 
background color so that the text area has a plain white background.  Just setting the item background color property does not seem to do it.
I am sure I am missing something simple! Please help!

Thanks

Clive

2 Answers, 1 is accepted

Sort by
0
Clive Hoggar
Top achievements
Rank 1
answered on 01 Nov 2012, 06:58 PM
OK ,  after following a few threads I have finally used this approach, which works for the insert and edit modes:
Protected Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
 
        If e.Item.IsInEditMode AndAlso (TypeOf e.Item Is GridEditFormItem) Then
            Dim gridEditFormItem As GridEditFormItem = DirectCast(e.Item, GridEditFormItem)
            Dim radEditor As RadEditor = DirectCast(gridEditFormItem("Body").Controls(0), RadEditor)
            radEditor.ContentAreaCssFile = "../css/editor.css"
            radEditor.Height = Unit.Pixel(750)
            radEditor.Width = Unit.Pixel(600)
             
        End If
    End Sub

The only snag is that the default green page background shows up again in the 'preview' mode. I tried "e.item.isinpreviewmode" approach but that is not valid!  

Can someone help?  There must be a simple answer!

Thanks

Clive
P.S using Q2 2010 release asp.net 4.0
0
Rumen
Telerik team
answered on 02 Nov 2012, 08:14 AM
Hello,

Replace this line radEditor.ContentAreaCssFile = "../css/editor.css" with

radEditor.CssFiles.Add("../css/editor.css");

For more information see this article: Content Area Appearance Problems.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Clive Hoggar
Top achievements
Rank 1
Answers by
Clive Hoggar
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or