Style and visual state of DataBoundListBox.ItemTemplate

2 posts, 0 answers
  1. Dan
    Dan avatar
    1 posts
    Member since:
    Jan 2013

    Posted 21 Feb 2013 Link to this post

    I have the following XAML for my RadDataBoundListBox.ItemTemplate, is it possible to define visual states and style within the DataTemplate? Or perhaps there is another alternative that will allow me to have greater flexibility from a style and state management point of view?

    <Controls1:RadDataBoundListBox.ItemTemplate>
        <DataTemplate>
            <Grid Margin="8, 8, 0, 12">
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition MinWidth="60" Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBlock
                  Foreground="{StaticResource PhoneForegroundBrush}"
                  Text="{Binding Name}"
                  FontSize="{StaticResource PhoneFontSizeExtraLarge}"
                FontFamily="Segoe WP SemiLight"/>
                <TextBlock
                  Grid.Row="1"
                  Foreground="{StaticResource PhoneSubtleBrush}"
                  Text="{Binding Description}"
                  TextWrapping="Wrap"
                  MaxHeight="54"
                 FontSize="{StaticResource PhoneFontSizeNormal}"/>
            </Grid>
        </DataTemplate>
    </Controls1:RadDataBoundListBox.ItemTemplate>

  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 22 Feb 2013 Link to this post

    Hello Dan,

    Visual States are not supported on DataTemplates. They are only supported in Control Templates.

    Could you please share some further info on what you're trying to achieve so that I see if I can give you another approach of doing it?

    Kind regards,
    Deyan
    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top