RadWrapPanel auto height

Thread is closed for posting
2 posts, 0 answers
  1. Stephan
    Stephan avatar
    29 posts
    Member since:
    May 2013

    Posted 12 Jun 2013 Link to this post


    I'm trying to have a RadWrapPanel that changes its height depending on the number of items. The reason is that I dynamically add/remove item depending on user actions. I placed the RadWrapPanel along other controls in a Grid with the following attributes.
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="64"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        <!-- tags -->
        <TextBlock Margin="10,10,0,0" TextWrapping="NoWrap" Text="Tags" VerticalAlignment="Top" HorizontalAlignment="Left" Foreground="Black" Grid.Column="0" Height="27" Width="422" Grid.ColumnSpan="3" Grid.Row="4"/>
        <telerikPrimitives:RadWrapPanel x:Name="WrapPanelTags" Grid.ColumnSpan="2" VerticalAlignment="Stretch" Grid.Row="5" />
        <Button x:Name="ButtonAddTags" Grid.Column="2" Style="{StaticResource RoundButton}" Grid.Row="5" VerticalAlignment="Top" Height="72" Click="ButtonAddTags_OnClick">
                <ImageBrush ImageSource="/Brainchest.TimeStamp.WP;component/Icons/button.add.png" Stretch="Fill"/>

    Doing this with a StackPanel is pretty straight forward as I just need to add the item height programmatically to the current stack panel height. But the advantage of the RadWrapPanel is that I can have multiple items in one line. Thus, my list gets smaller (height wise). But when I add too much items to fit on one line RadWrapPanel wraps the newest item but remains with the current height. Unfortunately, I can't calculate the height because of that reason.

    Any help is highly appreciated

    Kind Regards,

  2. Victor
    Victor avatar
    1358 posts

    Posted 14 Jun 2013 Link to this post

    Hello Stephan,

    Thanks for writing.
    RadWrapPanel does indeed change its height depending on how many items it has. Can you please explain in more detail what you are trying to achieve? Adding 100 tags makes the wrap panel 1200 pixels high.

    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top