RadDataForm basic layout

6 posts, 0 answers
  1. Marcelo
    Marcelo avatar
    40 posts
    Member since:
    Jul 2011

    Posted 16 Aug 2011 Link to this post

    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.
  2. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 22 Aug 2011 Link to this post

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

  3. UI for WPF is Visual Studio 2017 Ready
  4. Marcelo
    Marcelo avatar
    40 posts
    Member since:
    Jul 2011

    Posted 22 Aug 2011 Link to this post

    Hello Pavel. I am using AutoGenerateFields="True"
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Aug 2011 Link to this post

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

  6. Marcelo
    Marcelo avatar
    40 posts
    Member since:
    Jul 2011

    Posted 23 Aug 2011 Link to this post

    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?
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 23 Aug 2011 Link to this post

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

Back to Top
UI for WPF is Visual Studio 2017 Ready