tags:

views:

23

answers:

2

Hi,,,here in my WPF application am using listview with 5 columns and one of the column has flag value and my requirement is, if the flag value is True then i have to set the forground of the row to RED color....Thank you

A: 

Use a value converter

Resources

Or concider MVVM-like patern

rudigrobler
I cant get your code from msdn,beacuse am new to wpf,so could you please give me a clear solution for this nad here is my code – Prabhakaran 1 min ago edit I cant get your code from msdn,beacuse am new to wpf,so could you please give me a clear solution for this nad here is my code <GridViewColumn DisplayMemberBinding="{Binding Path=IsCompleted}" Width="50" > <GridViewColumnHeader HorizontalAlignment="Stretch">IsCompleted</GridViewColumnHeader> </GridViewColumn> if this value is TRUE i need to get the entire listitem foregrund as RED color
Prabhakaran
A: 

Create a style for the ListBoxItem with a DataTrigger that changes the color.

In fact, the MSDN entry on DataTrigger contains an example which is quite close to what you want: It changes the Foreground color to Red based on a data value.

Heinzi
I cant get your code from msdn,beacuse am new to wpf,so could you please give me a clear solution for this nad here is my code
Prabhakaran
<GridViewColumn DisplayMemberBinding="{Binding Path=IsCompleted}" Width="50" > <GridViewColumnHeader HorizontalAlignment="Stretch">IsCompleted</GridViewColumnHeader> </GridViewColumn> if this value is TRUE i need to get the entire listitem foregrund as RED color
Prabhakaran
Please show the XAML code of your complete ListView. You can use the "edit" button below your question to add it to your question.
Heinzi