By default the RadWrapPanel control will allocate as much space for an item as it needs. This means that you can place items with different dimensions
inside one and the same RadWrapPanel control and it will handle it. However, in case you want to specify a constant size for each item, the
RadWrapPanel control provides you with the ItemWidth and ItemHeight properties. They allow you to specify the desired width and
height which will get applied to each item inside the panel.
Note |
|---|
|
If the item is bigger than the specified size, it will get clipped! If it is smaller, it will usually get positioned in the
center of the allocated space.
|
Here is an example:
CopyC#
<telerikPrimitives:RadWrapPanel x:Name="radWrapPanel" Width="220" ItemWidth="110" ItemHeight="110">
<Border BorderBrush="White" BorderThickness="1" Width="100" Height="100" Background="#FF00BABD" />
<Border BorderBrush="White" BorderThickness="1" Width="100" Height="100" Background="#FF00BABD" />
<Border BorderBrush="White" BorderThickness="1" Width="100" Height="100" Background="#FF00BABD" />
<Border BorderBrush="White" BorderThickness="1" Width="100" Height="100" Background="#FF00BABD" />
<Border BorderBrush="White" BorderThickness="1" Width="100" Height="100" Background="#FF00BABD" />
</telerikPrimitives:RadWrapPanel>
Here is a snapshot of the result.