This is a migrated thread and some comments may be shown as answers.
Dynamic DataTemplates
2 Answers 31 Views
This is a migrated thread and some comments may be shown as answers.
Bryan Brannon
Top achievements
Rank 2
Bryan Brannon asked on 08 Apr 2011, 05:30 PM
Hello, I have a RadTileView and wondered how to change the DataTemplate for the RadTilveView.ItemTemplate (header) based on the state or configuration of the RadTileView?

Example:
<!-- TileView.HeaderTemplate -->
<DataTemplate x:Key="MinimizedHeaderTemplate">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="{Binding PatientName}" Width="125" Margin="14,0,0,0" />
    </StackPanel>
</DataTemplate>
  
<DataTemplate x:Key="MaximizedHeaderTemplate">
    <StackPanel Orientation="Horizontal">
        <TextBlock Text="{Binding PatientName}" Width="125" Margin="14,0,0,0" />
        <TextBlock Text="{Binding Age}" Width="30" Margin="14,0,0,0" />
        <TextBlock Text="{Binding Protocol}" Width="100" Margin="14,0,0,0" />
        <TextBlock Text="{Binding Actions}" Width="65" Margin="14,0,0,0" />
        <TextBlock Text="{Binding RegTime}" Width="75" Margin="14,0,0,0" />
    </StackPanel>
</DataTemplate>

Is there something I can bind the ItemTemplate to to evaluate the state of the currently selected item?

2 Answers, 1 is accepted

Sort by
0
Bryan Brannon
Top achievements
Rank 2
answered on 08 Apr 2011, 07:39 PM
I figured this out using the RadFluidContentControl described here.
http://www.telerik.com/help/wpf/radtileview-fluid-content-control.html

Basically, use one template and depending on the size of the content display different states of the templates.
0
Tina Stancheva
Telerik team
answered on 13 Apr 2011, 03:19 PM
Hello Bryan Brannon,

I am glad you found a solution to your scenario. You can also have a look at this article, which illustrate how to databind the RadTileView and take advantage of the RadFluidContentControl. You should also keep in mind that it is better to change the state of the FluidContentControl based on the TileState changes rather than relying on the Threshold properties.

I hope that info will help. Let us know if we can further assist you.

Greetings,
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
Asked by
Bryan Brannon
Top achievements
Rank 2
Answers by
Bryan Brannon
Top achievements
Rank 2
Tina Stancheva
Telerik team
Share this question
or