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

RadDataForm basic layout

5 Answers 195 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Marcelo
Top achievements
Rank 1
Marcelo asked on 16 Aug 2011, 07:35 PM
I am finding that the content of the RadDataForm control (using the Metro theme) is small. When I say "the content" I mean the fields within the RadDataForm control.

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

Sort by
0
Pavel Pavlov
Telerik team
answered on 22 Aug 2011, 02:24 PM
Hello Marcelo,

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 >>

0
Marcelo
Top achievements
Rank 1
answered on 22 Aug 2011, 04:42 PM
Hello Pavel. I am using AutoGenerateFields="True"
0
Vanya Pavlova
Telerik team
answered on 23 Aug 2011, 11:51 AM
Hello Marcelo,

 


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 >>

0
Marcelo
Top achievements
Rank 1
answered on 23 Aug 2011, 07:01 PM
Hello Vanya and thank you for the response. I have read and tried what you sent me and even though this showed me a few things I didn't know, it does not seem to address the different control's height I see when the FontSize is incerased (RadDataForm level). 

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?
0
Vanya Pavlova
Telerik team
answered on 23 Aug 2011, 07:25 PM
Hi Marcelo,

 
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.

 

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 >>

Tags
DataForm
Asked by
Marcelo
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Marcelo
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or