【WPF】设置Listview样式

 <ListView Grid.Row="0" ItemsSource="{Binding Lst_bind}">
                        <ListView.ItemContainerStyle>
                            <Style TargetType="{x:Type ListViewItem}">
                                <Setter Property="FontSize" Value="13"/>
                                <Setter Property="BorderBrush">
                                    <Setter.Value>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                            <GradientStop Color="LightBlue" Offset="0.5"/>
                                            <GradientStop Color="LightBlue" Offset="1"/>
                                        </LinearGradientBrush>
                                    </Setter.Value>
                                </Setter>
                                <Setter Property="BorderThickness" Value="0,0,0,0.4"/>
                                <Setter Property="Height" Value="35"/>
                            </Style>
                        </ListView.ItemContainerStyle>
                        
                        <ListView.View>
                            <GridView>
                                <GridView.Columns>
                                    <GridViewColumn DisplayMemberBinding="{Binding Name}" 
                                                    Width="200" Header="名字"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding Age}"
                                                    Width="200" Header="年龄"/>
                                    <GridViewColumn DisplayMemberBinding="{Binding Address}"
                                                    Width="200" Header="地址"/>
                                </GridView.Columns>
                            </GridView>
                        </ListView.View>
                    </ListView>

这里设置每一行只显示下边框;

posted @ 2013-12-30 17:51  YoMe  阅读(3653)  评论(0编辑  收藏  举报