When the basic layout is used, all controls are the same size. If I add for example FontSize="16" to the RadDataForm control, I get different sizes in the rendered controls. For example:
* The DateTime field is 6 pixels taller than the ComboBox
* The regular TextBox field is 3 pixels taller than the ComboBox
Also, the RadDataForm header seems to get bolded when the font size is increased. Finally, is there a way to establish the space between the labels (on the left) and the controls (on the right)?
Thanks in advance, Marcelo.
5 Answers, 1 is accepted
Are you using auto-generated fields or manually defined fields. I need to know this before providing some solution to you.
Regards,
Pavel Pavlov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Telerik Metro theme provides a completely new different user interface for RadControls/WPF. We are currently working on the improvement of this theme and the changes will be included in the upcoming Service Pack. You are right for some of the things you mentioned. RadDataForm provides styles which you may use to overcome these limitations. The Header property of RadDataForm is of type object and there you may define your own custom header in an appropriate manner. With a style targeted at DataFormDataField you may apply a style to the whole field. The LabelStyle which is designed to work with the labels to the left. Finally an implicit style targeted at some of the default editors will be handled correspondingly.
The snippet below demonstrates how this can be achieved:
<
Grid.Resources
>
<
Style
TargetType
=
"telerik:DataFormDataField"
>
<
Setter
Property
=
"telerik:StyleManager.Theme"
Value
=
"Metro"
/>
<
Setter
Property
=
"Height"
Value
=
"65"
/>
</
Style
>
<
Style
x:Key
=
"ss"
TargetType
=
"TextBlock"
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Right"
/>
</
Style
>
</
Grid.Resources
>
<
telerik:RadDataForm
x:Name
=
"DataForm1"
LabelStyle
=
"{StaticResource ss}"
FontSize
=
"16"
telerik:StyleManager.Theme
=
"Metro"
>
<
telerik:RadDataForm.Header
>
<
TextBlock
Style
=
"{x:Null}"
Foreground
=
"Red"
FontWeight
=
"Thin"
Text
=
"Something"
/>
</
telerik:RadDataForm.Header
>
</
telerik:RadDataForm
>
</
Grid
>
Hope this helps!
Best wishes,
Vanya Pavlova
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

To give you more details, if I use Height 16 ...
<
Setter
Property
=
"Height"
Value
=
"16"
/>
... the two Text Boxes in the RadDataForm almost disappear. The labels (left hand side) are gone and the controls themselves are about 4 pixels tall. If I use 65 (found in your code sample), I see all the controls but there is a "huge" gap between them. I could upload screen shots if I knew how :)
Are the improvements you are talking about going to address this issue?
Indeed you are quite right about the described behavior. When you change the DataFormField's Height in a style setter it will change its default height, it will not address the editor controls, because they come automatically with their own style based on a Telerik theme. You may change this using a style targeted at a TextBox, CheckBox, RadComboBox etc. or directly hard-code their parameters when you customize RadDataForm's fields. The snippet above is just a demonstration of customizing RadDataForm/WPF.
Vanya Pavlova
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>