WPF control listview
ID | Name | Address
----------------------------------
1 | Gia Ngoc | Vietnamses
2 | Jerry | US
How to add lines like in the diagram above to a ListVie开发者_JAVA技巧w?
Thanks
Edit: If you mean to add a visual seperators between the columns you probably need to implement your own view by inheriting from ViewBase
since the GridView
does not seem to be very customizable.
(Below i assumed that you wanted to add rows)
You need to set the ListView
.View
to a GridView
and define columns for it.
<ListView ItemsSource="{Binding Data}">
<ListView.View>
<GridView>
<GridViewColumn Header="ID" DisplayMemberBinding="{Binding Id}"/>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
<GridViewColumn Header="Address" DisplayMemberBinding="{Binding Address}"/>
</GridView>
</ListView.View>
</ListView>
精彩评论