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

Several themes for RadForm

4 Answers 178 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
superold
Top achievements
Rank 1
superold asked on 26 Sep 2008, 11:00 AM
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

4 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Sep 2008, 06:05 PM
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.
0
superold
Top achievements
Rank 1
answered on 29 Sep 2008, 10:16 PM
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


0
Peter
Telerik team
answered on 30 Sep 2008, 06:22 PM
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.
0
superold
Top achievements
Rank 1
answered on 30 Sep 2008, 07:22 PM
thank you. perfect
-j
Tags
Themes and Visual Style Builder
Asked by
superold
Top achievements
Rank 1
Answers by
Peter
Telerik team
superold
Top achievements
Rank 1
Share this question
or