Customized theme for label does not work.

6 posts, 0 answers
  1. Loc Hoang
    Loc Hoang avatar
    3 posts
    Member since:
    Jun 2004

    Posted 20 Sep 2007 Link to this post

    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
  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 21 Sep 2007 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Loc Hoang
    Loc Hoang avatar
    3 posts
    Member since:
    Jun 2004

    Posted 21 Sep 2007 Link to this post

    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.
  5. Peeter Ilumäe
    Peeter Ilumäe avatar
    2 posts
    Member since:
    Nov 2009

    Posted 19 Nov 2009 Link to this post

    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.
  6. Peeter Ilumäe
    Peeter Ilumäe avatar
    2 posts
    Member since:
    Nov 2009

    Posted 19 Nov 2009 Link to this post

    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:)
  7. Nick
    Admin
    Nick avatar
    767 posts

    Posted 23 Nov 2009 Link to this post

    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.
Back to Top
UI for WinForms is Visual Studio 2017 Ready