Hi,
I have RadListBox in windwo. Now I want to change the Item color based on the variable value then I am using below code to do that but it is not doing anything..so whats the wrong in it? Can someone tell me or how to do like this?
<telerik:RadListBox.Resources>
<Style TargetType="{x:Type telerik:RadListBoxItem}">
<Style.Triggers>
<DataTrigger x:Name="dtCovert" Binding="{Binding iscovert}" Value="true">
<Setter Property="Foreground" Value="Blue" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadListBox.Resources>-
My Control Usage
-------------------------
<telerik:RadListBox SelectionMode="Extended" Grid.Row="1" Grid.Column="0" Grid.RowSpan="5" Name="listBoxAvailableList" TabIndex="9" Width="260" Margin="2,0" ItemsSource="{Binding AvailableCameraList}" TypedText="{Binding cameraName}" PreviewMouseDoubleClick="listBoxAvailableList_PreviewMouseDoubleClick">
<telerik:RadListBox.ItemTemplate >
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*" />
<ColumnDefinition Width="4*" />
</Grid.ColumnDefinitions>
<Label Name="lblCameraName" Grid.Column="1" Visibility="Visible" Content="{Binding Path=cameraName,Mode=TwoWay}" Width="150"></Label>
</Grid>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>
I have RadListBox in windwo. Now I want to change the Item color based on the variable value then I am using below code to do that but it is not doing anything..so whats the wrong in it? Can someone tell me or how to do like this?
<telerik:RadListBox.Resources>
<Style TargetType="{x:Type telerik:RadListBoxItem}">
<Style.Triggers>
<DataTrigger x:Name="dtCovert" Binding="{Binding iscovert}" Value="true">
<Setter Property="Foreground" Value="Blue" />
</DataTrigger>
</Style.Triggers>
</Style>
</telerik:RadListBox.Resources>-
My Control Usage
-------------------------
<telerik:RadListBox SelectionMode="Extended" Grid.Row="1" Grid.Column="0" Grid.RowSpan="5" Name="listBoxAvailableList" TabIndex="9" Width="260" Margin="2,0" ItemsSource="{Binding AvailableCameraList}" TypedText="{Binding cameraName}" PreviewMouseDoubleClick="listBoxAvailableList_PreviewMouseDoubleClick">
<telerik:RadListBox.ItemTemplate >
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0*" />
<ColumnDefinition Width="4*" />
</Grid.ColumnDefinitions>
<Label Name="lblCameraName" Grid.Column="1" Visibility="Visible" Content="{Binding Path=cameraName,Mode=TwoWay}" Width="150"></Label>
</Grid>
</DataTemplate>
</telerik:RadListBox.ItemTemplate>
</telerik:RadListBox>