I have a DataGrid
with DataGridTemplateColumn.CellTemplate defined like this :
<DataGridTemplateColumn>
<DataGridTemplateColumn.Header>
<CheckBox ToolTip="Select all items"
IsChecked="{Binding IsSelected}" Name="chkSelectAll" Checked="AllItem_Checked"
Unchecked="UnCheckAll_UnChecked" IsHitTestVisible="{Binding Path=IsSelected}"/>
</DataGridTemplateColumn.Header>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<CheckBox HorizontalAlignment="Center" Checked="Item_Checked" Unchecked="Item_UnChecked"
IsChecked="{Binding IsSelected}" IsHitTestVisible="{Binding Path=IsSelected}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
The grid has a binding with a list of objects.
I want that, for each object of ItemsSource, if IsSelected attribut is TRUE the CHECKBOX BECOME IsReadOnly (can't be checked or uncheck.
I don't know how to perform this; I tried Binding IsHitTestVisible property to IsSelected ItemsSource Objects attribut but it's not working.
I googled about and found some topics about Multidatatriggers but can't understand how it's work.
Can someone help me ? I'm new with WPF.
Thank you.
Aucun commentaire:
Enregistrer un commentaire