expanding the ListPicker

2 posts, 0 answers
  1. Tareq
    Tareq avatar
    36 posts
    Member since:
    Jun 2011

    Posted 09 Aug 2011 Link to this post

    Hi Telerik,

    I am trying to create a list then under that a textbox and a button, it supposes to be easy, but when the list expands it somehow acts funny. the listpicker covers the rest of the controls, heres my code:

    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <telerikInput:RadListPicker InlineModeThreshold="7" Header="Choose the Calculation Method:" Height="100" HorizontalAlignment="Left" Margin="12,6,0,0" Name="lstCalculationMethod" VerticalAlignment="Top" Width="438" SelectionChanged="lstCalculationMethod_SelectionChanged" >
        <TextBox Height="72" HorizontalAlignment="Left" Margin="12,176,0,0" Name="textBox1" Text="" VerticalAlignment="Top" Width="280" />
        <Button Content="Search" Height="72" HorizontalAlignment="Left" Margin="290,176,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />
        <TextBlock Height="30" HorizontalAlignment="Left" Margin="24,154,0,0" Name="textBlock1" Text="Set your city:" VerticalAlignment="Top" />
        <ListBox Height="313" HorizontalAlignment="Left" Margin="24,268,0,0" Name="listBox1" VerticalAlignment="Top" Width="409" FontSize="28" />

    i tested it on both the emulator and the device
    am i messing something? please help
  2. Deyan
    Deyan avatar
    2026 posts

    Posted 10 Aug 2011 Link to this post

    Hello Tareq,

    Thanks for contacting us and for the provided XAML snippet.

    The reason for the undesired behavior is that you are positioning your items in a Grid by setting their top margin. In this way you are hardcoding their vertical position and in this way it is in no way dependant on the position of the item above.

    I suggest adding rows in your grid and putting each element in a row. In this way, when an element is resized, the other elements below will be correctly repositioned.

    I hope this helps.

    Best wishes,
    the Telerik team

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

  3. DevCraft banner
Back to Top