is it somehow possible to declare the telerik theme so that the controls would have their theme set in designer also?
I'm already setting theme code behind in Application_Startup like
StyleManager.ApplicationTheme = new Expression_DarkTheme();
But I would like to set the theme application wide so that I could see the rad controls wiht the dark theme also in design mode.
Best regards,
Niklas
5 Answers, 1 is accepted
When you set the theme on an application level you will be able to see the theme at runtime, not at design time. If you want to have design-time support you should set it on a control level, as shown below:
<
telerik:RadGridView
telerik:StyleManager.Theme
=
"Expression_Dark"
ItemsSource
=
"{Binding Collection}"
/>
Best wishes,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
this is not a good solution cause I would have to set the theme design time for _all_my_controls_ and what about when I would want to change the application wide theme then in code behind at runtime?
Currently for the design-time support this is the only available option - to set the theme on a control level.
In a similar manner you may change the theme on multiple controls using a plain RadComboBox, as shown below:
<
telerik:RadComboBox
x:Name
=
"combo"
SelectedIndex
=
"0"
HorizontalAlignment
=
"Right"
Height
=
"32"
Margin
=
"0,64,128,0"
VerticalAlignment
=
"Top"
Width
=
"152"
>
<
telerik:Office_BlackTheme
/>
<
telerik:Office_BlueTheme
/>
<
telerik:Office_SilverTheme
/>
<
telerik:Expression_DarkTheme
/>
<
telerik:MetroTheme
/>
</
telerik:RadComboBox
>
<
telerik:RadGridView
telerik:StyleManager.Theme
=
"{Binding ElementName=combo,Path=SelectedItem}"
ItemsSource
=
"{Binding Mode=OneWay}"
HorizontalAlignment
=
"Left"
Width
=
"208"
/>
<
telerik:RadButtontelerik:StyleManager.Theme
=
"{Binding ElementName=combo,Path=SelectedItem}"
Height
=
"22"
VerticalAlignment
=
"Bottom"
Content
=
"Click me"
/>
<
telerik:RadCalendartelerik:StyleManager.Theme
=
"{Binding ElementName=combo,Path=SelectedItem}"
Margin
=
"240,184,224,82"
/>
One you pick the theme from the RadComboCox control it will be applied to all controls bound in this way and you will have the desired design-time support.
Regarding the application runtime theme change you may refer to the following forum thread for further reference. The same is valid for WPF as well.
All the best,
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Thank you for contacting us.
The approach described above is valid for design-time support of Visual Studio designer, as well.
In addition to this, I strongly recommend you to use Implicit Styles, rather than StyleManager.
You could read more in our online documentation, following this link.
Regards,
Vanya Pavlova
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.