This is a migrated thread and some comments may be shown as answers.

Fixed maxheight and maxwidth of tileviewitem

3 Answers 48 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Nabil Shuhaiber
Top achievements
Rank 1
Nabil Shuhaiber asked on 19 Aug 2010, 05:26 PM
Is there anyway way to fix the maxheight and maxwidth of a tileviewitem? I don't wan't the tileviewitem to exceed a certain size when resizing.

Regards,
Nabil

3 Answers, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 19 Aug 2010, 05:52 PM
Hello Nabil Shuhaiber,

If the RadTileView is data bound you can use an ItemContainerStyle to set the MaxWidth and MaxHeight properties of the RadTileViewItems, like so:
<Style x:Key="ItemContainerStyle" TargetType="telerik:RadTileViewItem">
    <Setter Property="MaxHeight" Value="200"/>
    <Setter Property="MaxWidth" Value="200"/>
</Style>

In any other case you can set those properties to each RadTileViewItem when it's defined.

I prepared a sample project illustrating the first approach. give it a try and let me know if it works for you or if you need more info.

Kind regards,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nabil Shuhaiber
Top achievements
Rank 1
answered on 19 Aug 2010, 05:55 PM
The problem with this method as you can see in the sample you sent me is the whitespace around the item. Is there any way I can reduce that to the standard tileview defaults?
0
Tina Stancheva
Telerik team
answered on 19 Aug 2010, 06:20 PM
Hi Nabil Shuhaiber,

By design the restored RadTileViewItems are evenly displayed in the available space - the space that is set through the Width and Height properties of the RadTileView. Also, the space between the items is set through the Padding property of the RadTileViewItem and in the default RadTileView style its value is 7. Therefore, if you need to modify it, you will need to implicitly define a new value for it.
<Style x:Key="ItemContainerStyle" TargetType="telerik:RadTileViewItem">
    <Setter Property="MaxHeight" Value="200"/>
    <Setter Property="MaxWidth" Value="200"/>
    <Setter Property="Padding" Value="1"/>
</Style>

Also, you can take a look at this blog post that might be helpful as well.

Sincerely yours,
Tina Stancheva
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
TileView
Asked by
Nabil Shuhaiber
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Nabil Shuhaiber
Top achievements
Rank 1
Share this question
or