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

TileViewItem - dynamically hiding Header

2 Answers 115 Views
TileView
This is a migrated thread and some comments may be shown as answers.
mitica
Top achievements
Rank 1
mitica asked on 10 Jun 2011, 02:36 PM
Hi,

I am trying to implement  the following scenario.
There is a RadTileView using RadFluidContentControl, with the itemssource set to a collection of business objects exposing 3 different views for: Small, Normal, Large content.

The LargeContent is a UserControl that already has a header so I would like to dynamically hide the header of the TileViewItem, but only for the Maximized Item. I assume that I need to get a reference to one of the following TileViewItem template elements:

<Grid MinHeight="28">
    <Border x:Name="GripBarElement" Background="Transparent">
        <ContentPresenter x:Name="HeaderElement" HorizontalAlignment="Left"/>

I plan to include my own button in the user control's header to use for minimeze (on click, manually change the state of maximized tileview item).

For the other 2 states (Restored and Minimized) the default header should remain as it allows rearranging, maximize on dbl-click and offers the default buttons (useful in these 2 states).

Can you please show me how can I achieve the following
- how to access the header element in my own application (code)
- where is the proper place to hide the header. (what event of the RadTileView)

Thank you.

2 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 13 Jun 2011, 04:32 PM
Hi mitica,
Unfortunately there no straightforward way to access the header elements. You'll have to use the ChildrenOfType method and find them by name. I think that the easiest way to achieve your functionality will be to create a custom RadTileViewItem template with two headers - the default one for Restored and Minimized and one for when the item is Maximized. You can handle the TileStateChanged event of the RadTileView and in it depending on the state of the item you can collapse one of the headers.
For further references could you please examine the attached project and if you have more questions feel free to ask.

Greetings,
Zarko
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
mitica
Top achievements
Rank 1
answered on 14 Jun 2011, 05:47 AM
Hello Zarko,

thank you for your answer. It works like a charm.
Very smart solution.

Best regards,
mitica.
Tags
TileView
Asked by
mitica
Top achievements
Rank 1
Answers by
Zarko
Telerik team
mitica
Top achievements
Rank 1
Share this question
or