Docking (header, footer, middle)

6 posts, 0 answers
  1. Labarque
    Labarque avatar
    10 posts
    Member since:
    Sep 2013

    Posted 14 Jan 2014 Link to this post

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
     
        <Button Content="test1" />
         
        <GroupBox Grid.Row="1" Header="test2"/>
         
        <Button Grid.Row="2" Content="test3"/>
    </Grid>
    When you use the code above, you have a nice header, footer, middle structure (the middle is stretched).
    When you place this inside the DataTemplate of a RadDataForm, the middle doesn't get stretched.
    How is it possible to stretch the middle inside a RadDataForm?

    Thank you!
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 15 Jan 2014 Link to this post

    Hello Vincent,


    Thank you for contacting us!
    You may predefine the template of RadDataForm and alter the specified StackPanel, that holds
    AutoGeneratedFieldsPresenter and FieldsContentPresenter for manually defined templates, as follows:

    <ScrollViewer x:Name="PART_ItemsScrollViewer" IsTabStop="False"  telerik:StyleManager.Theme="{StaticResource Theme}" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto"/>
                                <RowDefinition Height="auto"/>
                            </Grid.RowDefinitions>
                            <dataForm:AutoGeneratedFieldsPresenter x:Name="PART_AutoGeneratedFieldsPresenter" AutoGenerateFields="{Binding AutoGenerateFields,RelativeSource={RelativeSource TemplatedParent}}" telerik:StyleManager.Theme="{StaticResource Theme}"  />
                            <ContentPresenter x:Name="PART_FieldsContentPresenter" Grid.Row="1"/>
                        </Grid>
                    </ScrollViewer>


    Hope this helps!

    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Labarque
    Labarque avatar
    10 posts
    Member since:
    Sep 2013

    Posted 15 Jan 2014 Link to this post

    Hello

    Thank you for the reply, but I do not understand fully what you mean and how it should be implemented.

    Is it possible to clarify this further?

    Thank you!

  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 15 Jan 2014 Link to this post

    Hi Vincent,


    I am attaching you small sample demo, which illustrates how to modify the default template of RadDataForm in order to achieve the desired result. I have also modified the second row definition to use star sizing instead of auto height definition.


    Please check the attached project and let us know, how it corresponds to your needs. 



    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Labarque
    Labarque avatar
    10 posts
    Member since:
    Sep 2013

    Posted 15 Jan 2014 Link to this post

    Hello

    Thank you, this works perfectly.
    A small question: I see that the bar (with the ok and cancel button) has a fixed color and the background of the RadDataForm. How can I change this so that it is adapted to the theme that has been chosen (such as the standard) ?

    Thank you!
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 Jan 2014 Link to this post

    Hello Vincent,


    Thank you for getting back to us! Ok and Cancel buttons are part of RadDataForm's footer. Since the styles and their resources used in our themes are theme specific (you have a separate style for each theme) you should modify the template for the desired theme and switch it at runtime, as described here. 



    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top
UI for WPF is Visual Studio 2017 Ready