Auto height of the dataform

2 posts, 1 answers
  1. Edward
    Edward avatar
    45 posts
    Member since:
    Aug 2005

    Posted 18 Apr 2012 Link to this post


    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"/>
               <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">
             <Canvas Name="CameraCanvas" Margin="10">

    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?


  2. Answer
    Vlad avatar
    11100 posts

    Posted 19 Apr 2012 Link to this post

    Hello Edward,

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

    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top