我正在使用listview(gridview/gridviewcolumn) 其中第一列 只包含每行的複選框。我不想添加全選按鈕,而是想要 將複選框添加到第一列的標題中。gridviewcolumn(header)中的複選框
選中標題中的複選框將選擇 所有其他複選框,反之亦然。
我該如何在xaml中做到這一點?
更新: 這是我的xaml代碼的重要組成部分。 (簡體)
<ListView ItemSource="...">
<ListView.View>
<GridView>
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox IsChecked="{Binding IsSelected}" />
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
你到底做了什麼來實現你的目標?顯示你的一些代碼/ XAML – 2011-05-17 17:21:06
用當前的xaml代碼更新了我的問題。 – Ferhat 2011-05-17 18:44:51
請參閱下面的回答 – 2011-05-17 19:43:15