Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27441

VS 2010 How to set the ListView cell text or background color

$
0
0
Hi all.

I am new to WPF and I am trying to change the cell text or background color in the cell.

Example
Cell >= 1.25 change color to red
Cell <= 1.24 change color to green

Here's my xaml
Code:

            <ListView.View>
                <GridView x:Name="myGridView">
                    <GridViewColumn Width="225" Header="Name" DisplayMemberBinding="{Binding theName}"  TextElement.Foreground="{Binding color1}"/>
                    <GridViewColumn Width="165" Header="Data Value" DisplayMemberBinding="{Binding theDate}" TextElement.Foreground="{Binding color2}"/>
                </GridView>
            </ListView.View>

How do I get this to work.

Thanks.

Viewing all articles
Browse latest Browse all 27441

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>