次の形式で WPF ツールキット データグリッドを作成しようとしています。データ グリッドの LoadingRow イベントで列のコンテンツを非表示にすることができました。しかし、最後の列はボタンであり、そのコンテンツを非表示にする方法がわかりません。名前ごとに 1 回だけ表示する必要があります。これを達成する方法について何か提案はありますか?
ありがとうDM
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Content="Delete"
Visibility="{Binding CanDelete, Converter={StaticResource BoolToVisibility}}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
CanDelete is a bool property on your Row Binding on your List , change it to true when needed PropertyChanged + Binding will do the rest.