开发者

WPF control listview

开发者 https://www.devze.com 2023-02-24 17:22 出处:网络
ID|Name| Address ---------------------------------- 1| Gia Ngoc| Vietnamses 2| Jerry| US How to add lines like in the diagram above to a ListVie开发者_JAVA技巧w?
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>
0

精彩评论

暂无评论...
验证码 换一张
取 消