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

Auto height of the dataform

1 Answer 68 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Edward
Top achievements
Rank 2
Edward asked on 18 Apr 2012, 07:20 PM
Hi

I love the control so far :)  It works as expected. Very good.   

I don't know if i'm in the right thread with this question because I suspect something generic about my question but here it goes:

I have a usercontrol which has some stack panels with buttons and a DataForm like:

<Grid x:Name="LayoutRoot" Background="White">
 
    <StackPanel Orientation="Horizontal" >
 
        <StackPanel Orientation="Vertical" >
 
             <StackPanel Orientation="Horizontal">
                <telerik:RadRadioButton Margin="0,5,5,5" Content="Normal" HorizontalAlignment="Left" IsChecked="True" Name="rbNormalView" Click="RrbClick" CommandParameter="1" />
                <telerik:RadRadioButton Margin="0,5,5,5" Content="Passes" HorizontalAlignment="Left" IsChecked="False" Name="rbPassView" Click="RrbClick" CommandParameter="0"/>
             </StackPanel>
 
                 
           <telerik:RadDataForm EditEnding="RadDataFormVisitor_OnEditEnding"  VerticalAlignment="Stretch" HorizontalAlignment="Left" HorizontalContentAlignment="Left"  LabelPosition="Beside" Width="400" Name="radDataFormVisitor" BorderThickness="1" AutoEdit="True" AutoGeneratingField="RadDataForm1AutoGeneratingField" CommandButtonsVisibility="None">
              </telerik:RadDataForm>
                          
             
        </StackPanel>
 
         <Canvas Name="CameraCanvas" Margin="10">
        </Canvas>
 
     </StackPanel>
 
</Grid>


The problem is that I need to set the height of the dataform in pixels otherwise it will grow outside the usercontrol. I want the dataform to auto-height (or auto fill) to the height of the usercontrol. The dataform will show its own vertical scrollbar if neccesary.

How do I do that? Do I need docking?


Thanks,
Edward



1 Answer, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 19 Apr 2012, 07:19 AM
Hello Edward,

 You should use Grid panel instead StackPanel since StackPanel  will measure child components with infinity height.

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DataForm
Asked by
Edward
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Share this question
or