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

RadDock theming

9 Answers 337 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Richard Slade
Top achievements
Rank 2
Richard Slade asked on 09 Jul 2009, 10:40 AM
Hello,

Our MDI Application has a RadDock in the main workspace.
The theme has been reset.
I allow the users to choose a theme for the application, and on choosing the theme, all of the controls have the theme applied correctly.

If the user choosers Office2007Silver, then the background colour of the RadDock changes correctly to a silver/grey colour.
On all other themes, the background colour stays the default blue.

I'd like it to change together with the theme choice correctly. My available themes to choose are:
Office2007Silver
Default
Breeze
Desert
Vista

If this is not possible, I'd like to just set the background colour to a default of my choice, but choosing a new background colour for raddock (or the document container or dock panel) doesn't seem to make any difference.

Thanks

9 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 09 Jul 2009, 02:55 PM
Hello Richard,

Currently we support Office2007Silver and ControlDefault themes from the list you provided.
We will consider adding Breeze, Vista and Desert themes to Q2 2009 SP1 if we manage to implement the already promised functionality and fixes.

Regards,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard Slade
Top achievements
Rank 2
answered on 10 Jul 2009, 09:31 AM
Thanks for your reply Victor. However, this doesn't explain why I can't seem to set a default back colour on the control. If I could at least set the default back colour to grey, then it would fit in with all themes, rather than the blue that it is currently set to.

Many thanks

Richard
0
Victor
Telerik team
answered on 14 Jul 2009, 02:58 PM
Hi Richard Slade,

The back color you are seeing is the back color of the main document container. You can currently change the color through code like so:
 
this.radDock1.MainDocumentContainer.BackColor = Color.Gray; 
 
Note that the MainDocumentContainer property is set to Browsable.Never because the property has a setter, which is required by the serialization mechanism. It has been hidden to prevent users from changing the container dynamically and thus causing themselves trouble.

 
Sincerely yours,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard Slade
Top achievements
Rank 2
answered on 14 Jul 2009, 04:16 PM
Hello Victor,

This still doesn't work for me.

Example, I have
RadForm BackColor set to AppWorkspace
RadDock.BackColor set to Transparent
DockPanel BackColor set to Transparent
DocumentContainer BackColor set to Transparent

I have tried setting colors for all of the RadDock items to no affect.

I have also set the RadDock.MainDocumentContainer.BackColor (which I understand is the same as DocumentContainer) BackColor to Gray programmatically which still has no affect.

Richard
1
Victor
Telerik team
answered on 17 Jul 2009, 01:47 PM
Hello Richard Slade,

Please accept my apologies. When I used the latest version the suggested approach stopped working. In order to set the back color, you should do the following:
this.radDock1.MainDocumentContainer.BackColor = Color.Pink;  
RadElement el = this.radDock1.MainDocumentContainer.RootElement.Children[0].Children[0];  
(el as FillPrimitive).BackColor = this.BackColor; 
Let us know if we can help with anything else.

Greetings,
Victor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard Slade
Top achievements
Rank 2
answered on 21 Jul 2009, 10:11 AM
Thanks.
For anyone else, this translates into VB as
            Dim element As Telerik.WinControls.RadElement = Me.DocumentContainer.RootElement.Children(0).Children(0)  
            DirectCast(element, Telerik.WinControls.Primitives.FillPrimitive).BackColor = Drawing.Color.Silver 


Richard

 

0
Richard Slade
Top achievements
Rank 2
answered on 22 Jul 2009, 01:38 PM
Thought someone else might also be interested in this.
The rad dock doesn't seem to accept all themes, and the background of a RadDock can sometimes look out of place with the current theme.

For us, we have an MDI Application, with AutoDetect MDI Children set to true. When we change the theme to anything but Office2007Silver, or Default, then the background color can look a bit odd.(stays the default blue)

to get around this, set your background color of your form, rad dock, maindocumentcontainer and dock panel to transparent. then pick up the backcolor changed event of one of the controls that will have it's color changed as you want it.

Here, I am picking up the back color of my main menu

        Private Sub MainMenu_BackColorChanged(ByVal sender As System.Object, _  
                ByVal e As System.EventArgs) Handles MainMenu.BackColorChanged  
 
            Dim element As Telerik.WinControls.RadElement = Me.DocumentContainer.RootElement.Children(0).Children(0)  
            DirectCast(element, Telerik.WinControls.Primitives.FillPrimitive).BackColor = Me.MainMenu.BackColor  
        End Sub 

Hope that helps someone

Richard
0
Joris
Top achievements
Rank 1
answered on 19 Jan 2010, 11:24 AM
Hello,

Thanks for this background tip.
It works.

But can I change the background where the tabs are also?
Thanks in advance

Joris
0
Nikolay
Telerik team
answered on 22 Jan 2010, 02:10 PM
Hi Joris,

Currently, you can change the color of the TabStripElements by manually editing the RadDock xml theme files.

A RadDock theme contains several xml theme files for the different RadDock parts. I am attaching a sample project to demonstrate this. Here are the changes which you need to make:
1. Open TabStrip.xml and find the following code snippet:
<XmlPropertySettingGroup>
  <PropertySettings>
    <XmlPropertySetting Property="Telerik.WinControls.VisualElement.BackColor" Value="191, 219, 254" />
    <XmlPropertySetting Property="Telerik.WinControls.UI.RadTabStripElement.ItemsOffset" Value="1" />
  </PropertySettings>
  <Selectors>
    <XmlTypeSelector ElementType="Telerik.WinControls.UI.RadTabStripElement" />
  </Selectors>
</XmlPropertySettingGroup>

2. Change the BackColor according to your preferences and Insert the following line in the PropertySettings block:
<XmlPropertySetting Property="Telerik.WinControls.RadElement.ShouldPaint" Value="True" />

The result code block is:
<XmlPropertySettingGroup>
  <PropertySettings>
    <XmlPropertySetting Property="Telerik.WinControls.VisualElement.BackColor" Value="Red" />
    <XmlPropertySetting Property="Telerik.WinControls.UI.RadTabStripElement.ItemsOffset" Value="1" />
    <XmlPropertySetting Property="Telerik.WinControls.RadElement.ShouldPaint" Value="True" />
  </PropertySettings>
  <Selectors>
    <XmlTypeSelector ElementType="Telerik.WinControls.UI.RadTabStripElement" />
  </Selectors>
</XmlPropertySettingGroup>

The same operations should be performed in this code block:
<XmlPropertySettingGroup>
  <PropertySettings>
    <XmlPropertySetting Property="Telerik.WinControls.VisualElement.BackColor" Value="191, 219, 254" />
    <XmlPropertySetting Property="Telerik.WinControls.UI.RadTabStripElement.ItemsOffset" Value="13" />
  </PropertySettings>
  <Selectors>
    <XmlTypeSelector ElementType="Telerik.WinControls.UI.RadTabStripElement" />
  </Selectors>
</XmlPropertySettingGroup>

For your convenience, I made the necessary changes in the TabStrip.xml. You can just replace the Red color with your own color.

I hope this helps. If you have additional questions, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Dock
Asked by
Richard Slade
Top achievements
Rank 2
Answers by
Victor
Telerik team
Richard Slade
Top achievements
Rank 2
Joris
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or