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

Style and visual state of DataBoundListBox.ItemTemplate

1 Answer 33 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dan
Top achievements
Rank 1
Dan asked on 21 Feb 2013, 01:41 PM
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>

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 22 Feb 2013, 08:31 AM
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.
Tags
DataBoundListBox
Asked by
Dan
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or