Several themes for RadForm

5 posts, 0 answers
  1. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 26 Sep 2008 Link to this post

    Hi.

    I am trying to create several themes for different RadForms but I only get one to work. What is the type of registration that has to be made to apply different themes depending on the class name? is it possible? 

    thanks
    -j
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 26 Sep 2008 Link to this post

    Hi Jorge,

    I am not quite sure if I understand your scenario. Could you please clarify your goal? Do you need to use different forms with different themes in one application? If yes, which one of the following is working currently - one theme for all forms, or just one form has a theme? Also, what do you mean by "apply different themes depending on the class name" - how does this apply to the forms?

    Thank you for the cooperation.
     

    Sincerely yours,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 29 Sep 2008 Link to this post

    Hi!

    My goal is to be able to theme several forms differently. Form A with TitleBar but not Form B for instance and I wonder if this can be done with StylesheetRelations.

    Theme T for RadForm (default)
          <StylesheetRelations>
            <RadStylesheetRelation RegistrationType="ElementTypeControlType" ControlType="Telerik.WinControls.RadForm" ElementType="Telerik.WinControls.RootRadElement" />
            <RadStylesheetRelation ElementType="Telerik.WinControls.UI.RadFormElement" RegistrationType="ElementTypeDefault" />
          </StylesheetRelations>

    Theme T for MyOwnRadForm : RadForm

    How do i make the relation here? I have tried different relations without success.
          <StylesheetRelations>
            <RadStylesheetRelation RegistrationType="ElementTypeControlType" ControlType="somenamespace.MyOwnRadForm" ElementType="Telerik.WinControls.RootRadElement" />
          </StylesheetRelations>

    Thanks,
    -j


  5. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 30 Sep 2008 Link to this post

    Hi,

    I am afraid that the scenario is not applicable to RadForm because RadForm overrides the ClassName property and always returns "RadForm". This avoids returning the instance name of the form (like "Form1").

    You should create, apply and use separate themes for RadForm.
     
    For example - MyTheme1 for FormA and MyTheme2 for FormB

    On the other hand you can inherit the RadForm class and override ClassName to respond to StylesheetRelations property in the theme - see the attached project.
     

    Regards,
    Peter
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Jorge Delgado-Lopez
    Jorge Delgado-Lopez avatar
    82 posts
    Member since:
    Aug 2007

    Posted 30 Sep 2008 Link to this post

    thank you. perfect
    -j
Back to Top
UI for WinForms is Visual Studio 2017 Ready