protected void OnThemeChanged() { Theme theme = ThemeResolutionService.GetTheme(ThemeResolutionService.ApplicationThemeName); foreach (StyleGroup styleGroup in theme.StyleGroups) { foreach (PropertySettingGroup propertySettingGroup in styleGroup.PropertySettingGroups) { if (propertySettingGroup.Selector.Value == "RadFormElement") { foreach (PropertySetting propertySetting in propertySettingGroup.PropertySettings) { if (propertySetting.Name == "BackColor") { this.BackColor = (Color)propertySetting.Value; return; } } } if (styleGroup.Registrations[0].ControlType == "Telerik.WinControls.UI.RadForm" && propertySettingGroup.Selector.Value == "Telerik.WinControls.RootRadElement") { foreach (PropertySetting propertySetting in propertySettingGroup.PropertySettings) { if (propertySetting.Name == "BackColor") { this.BackColor = (Color)propertySetting.Value; return; } } } } } }
private void ThemeDropDown_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) { string strTheme = themeDropDown.Text; Theme theme = ThemeResolutionService.GetTheme(strTheme); if (theme != null) { ThemeResolutionService.ApplicationThemeName = theme.Name; } }