Tôi muốn có thể ẩn tiêu đề ở đầu mỗi cột lưới trong một ListView WPF.Làm cách nào để ẩn tiêu đề của WPF danh sách?
Đây là XAML cho ListView của tôi:
<Window x:Class="ListViewTest.Test0.ListViewTest"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Empty ListView Grid" Height="216" Width="435" FlowDirection="LeftToRight" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.IsSharedSizeScope="False">
<Window.Resources>
<XmlDataProvider x:Key="CustomersDS" Source="C:\data.xml"/>
</Window.Resources>
<ListView Margin="0,0,0,50" ItemTemplate="{DynamicResource CustomerTemplate}" ItemsSource="{Binding Source={StaticResource CustomersDS}, XPath=/Customers/Customer}">
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding XPath=Code}"/>
<GridViewColumn DisplayMemberBinding="{Binding XPath=Name}"/>
<GridViewColumn DisplayMemberBinding="{Binding XPath=Country}"/>
</GridView>
</ListView.View>
</ListView>
</Window>
Các dữ liệu tôi ràng buộc này để là:
<Customers>
<Customer>
<Code>1234</Code>
<Name>EPI</Name>
<Country>Sesame Street</Country>
</Customer>
<Customer>
<Code>3234</Code>
<Name>Paul</Name>
<Country>United Kingdom</Country>
</Customer>
<Customer>
<Code>3344</Code>
<Name>Juan</Name>
<Country>Spain</Country>
</Customer>
<Customer>
<Code>4321</Code>
<Name>Dodo</Name>
<Country>Mars</Country>
</Customer>
</Customers>
Không phải đây là FrameworkElement.Visibility, ít nhất trong WPF 3.5? (Tôi biết đây là một chủ đề cũ, nhưng nó ở trên cùng trên Google, vì vậy nó rất hữu ích cho nhiều người) –
Nó không cần thiết. Bạn đã chỉ định loại mục tiêu, vì vậy bạn không cần chỉ định vị trí của thuộc tính. – Ray
Bài đăng tuyệt vời ... đã lưu cho tôi một đống thời gian và đã xử lý .. cảm ơn – Kev