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

Docking (header, footer, middle)

5 Answers 96 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
ks
Top achievements
Rank 1
ks asked on 14 Jan 2014, 07:34 PM
<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!

5 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 15 Jan 2014, 03:56 PM
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 >>
0
ks
Top achievements
Rank 1
answered on 15 Jan 2014, 04:33 PM

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!

0
Vanya Pavlova
Telerik team
answered on 15 Jan 2014, 07:35 PM
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 >>
0
ks
Top achievements
Rank 1
answered on 15 Jan 2014, 08:03 PM
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!
0
Vanya Pavlova
Telerik team
answered on 16 Jan 2014, 09:25 AM
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 >>
Tags
DataForm
Asked by
ks
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
ks
Top achievements
Rank 1
Share this question
or