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

Customized theme for label does not work.

5 Answers 272 Views
Tools - VSB, Control Spy, Shape Editor
This is a migrated thread and some comments may be shown as answers.
Loc Hoang
Top achievements
Rank 1
Loc Hoang asked on 20 Sep 2007, 03:50 PM
Control version: RadControls for WinForms Q2 2007

I created a theme for my labels to have the following property:
<?xml version="1.0" encoding="utf-8"?>
<XmlTheme xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" ThemeName="TestTheme">
  <BuilderRegistrations>
    <XmlStyleBuilderRegistration BuilderType="Telerik.WinControls.DefaultStyleBuilder">
      <StylesheetRelations>
        <RadStylesheetRelation ElementType="Telerik.WinControls.RootRadElement" RegistrationType="ElementTypeControlType" ElementName="" ControlName="" ControlType="Telerik.WinControls.UI.RadLabel" />
      </StylesheetRelations>
      <BuilderData xsi:type="XmlStyleSheet">
        <PropertySettingGroups>
          <XmlPropertySettingGroup>
            <PropertySettings>
              <XmlPropertySetting Property="Telerik.WinControls.VisualElement.Font" Value="Arial, 9pt, style=Bold" />
              <XmlPropertySetting Property="Telerik.WinControls.VisualElement.ForeColor" Value="ActiveCaption" />
            </PropertySettings>
            <Selectors>
              <XmlTypeSelector ElementType="Telerik.WinControls.UI.RadLabel+RadLabelRootElement" />
            </Selectors>
          </XmlPropertySettingGroup>
          <XmlPropertySettingGroup>
            <PropertySettings />
            <Selectors>
              <XmlTypeSelector ElementType="Telerik.WinControls.UI.RadLabelElement" />
            </Selectors>
          </XmlPropertySettingGroup>
        </PropertySettingGroups>
      </BuilderData>
    </XmlStyleBuilderRegistration>
  </BuilderRegistrations>
</XmlTheme>

When I selected my customized theme for the label, it defaulted back to the original setting. Please advise

5 Answers, 1 is accepted

Sort by
0
Mike
Telerik team
answered on 21 Sep 2007, 12:01 PM
Hello Loc Hoang,

The problem seems to be related to the default values the VSB when saving the theme, which are different in the case of RadLabel. I'll make sure this gets changed accordingly in the next SP version of the products. Until then you can use the element UI editor in design time to customize the label's appearance OR you have to modify the xml theme file manually, after modifying using VSB app.

The line:

<RadStylesheetRelation ElementType="Telerik.WinControls.UI.RootRadElement" RegistrationType="ElementTypeControlType" ElementName="" ControlName="" ControlType="Telerik.WinControls.UI.RadLabel" />

should become:

<RadStylesheetRelation ElementType="Telerik.WinControls.UI.RadLabel+RadLabelRootElement" RegistrationType="ElementTypeControlType" ElementName="" ControlName="" ControlType="Telerik.WinControls.UI.RadLabel" />

I've attached the modified version of the original XML.


Best wishes,
Mike
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Loc Hoang
Top achievements
Rank 1
answered on 21 Sep 2007, 03:48 PM
Mike:
Thanks for the quick reply. I've changed my xml file as instructed and my customed theme name disapeared from the theme selection for the Label. I have to mannually type the theme name and it works. Thanks again.
0
Peeter Ilumäe
Top achievements
Rank 1
answered on 19 Nov 2009, 10:37 AM
Hi,

I'm trying out your Windows Forms component set here and I've run into a similar issue here, that I think might in some way related to above.

I have a RadForm where I've added various RadControls among others a  RadLabel.

After adding a Breeze theme to the form and all the controls I noticed there was no way to apply the theme to RadLabel control - the name of the theme just won't show up on theme selection menu?

Is there a workaround to this or am I doing something wrong?

Edit: Forgot to mention  - I am using the latest version of the toolset.
0
Peeter Ilumäe
Top achievements
Rank 1
answered on 19 Nov 2009, 01:07 PM
So it turned out the fix was simple - I didn't have to do anything to the label - on form area it works fine.

In a Breeze themed radGroupBox however it's background color is gray while the boxes' background is white. And while the label didn't adapt to the new container automatically it is simple enough to change the labels background color to white manually. 

Problem solved:)
0
Nick
Telerik team
answered on 23 Nov 2009, 09:32 AM
Hi Peeter Ilumäe,

I am glad to see that you found a solution.

Greetings,
Nick
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
Tools - VSB, Control Spy, Shape Editor
Asked by
Loc Hoang
Top achievements
Rank 1
Answers by
Mike
Telerik team
Loc Hoang
Top achievements
Rank 1
Peeter Ilumäe
Top achievements
Rank 1
Nick
Telerik team
Share this question
or