Dynamic DataTemplates

3 posts, 0 answers
  1. Bryan Brannon
    Bryan Brannon avatar
    65 posts
    Member since:
    Aug 2012

    Posted 08 Apr 2011 Link to this post

    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. Bryan Brannon
    Bryan Brannon avatar
    65 posts
    Member since:
    Aug 2012

    Posted 08 Apr 2011 Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 13 Apr 2011 Link to this post

    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
Back to Top