This question is locked. New answers and comments are not allowed.
Hi,
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.
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"
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"1*"
/>
<
ColumnDefinition
Width
=
"1*"
/>
<
ColumnDefinition
Width
=
"64"
/>
</
Grid.ColumnDefinitions
>
<
Grid.RowDefinitions
>
...
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
...
</
Grid.RowDefinitions
>
...
<!-- 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"
>
<
Button.Foreground
>
<
ImageBrush
ImageSource
=
"/Brainchest.TimeStamp.WP;component/Icons/button.add.png"
Stretch
=
"Fill"
/>
</
Button.Foreground
>
</
Button
>
...
</
Grid
>
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,
Stephan