2
我有一個複選框的數據網格。當我單擊單元格時,我希望在選中包含單元格的單元格時自動檢查該複選框。現在正在做的是,我需要選擇單元格,然後點擊複選框,這對我們來說非常煩人。數據網格複選框自動化
<dg:DataGrid Name="GridUsureOperation" Margin="10,444,82,6" ItemsSource="{Binding}" Style="{StaticResource GridMenu}" SelectionMode="Single" SelectionUnit="Cell">
<dg:DataGrid.Columns>
<dg:DataGridTextColumn Header="Opération" Width="*" MinWidth="60"
Binding="{Binding Operation.DescOperation}"
IsReadOnly="True" />
<dg:DataGridTextColumn Header="Dernière maintenance" Width="SizeToHeader" MinWidth="50"
Binding="{Binding DateDerniereMaintenance, StringFormat=yyyy-MM-dd}"
IsReadOnly="True"/>
<dg:DataGridTextColumn Header="Usure dernière maintenance" Width="SizeToHeader" MinWidth="50"
Binding="{Binding UsureDerniereOperation}"
IsReadOnly="True"/>
<dg:DataGridTextColumn Header="Fréquence(usure)" Width="SizeToHeader" MinWidth="50"
Binding="{Binding QteUsure}"
IsReadOnly="True"/>
<dg:DataGridTextColumn Header="Unité" Width="SizeToHeader" MinWidth="50"
Binding="{Binding TypeUsure.Description}"
IsReadOnly="True"/>
<dg:DataGridCheckBoxColumn Header="Forcer?" Width="SizeToHeader" MinWidth="50"
Binding="{Binding AfficherMaintenance}"
IsReadOnly="False">
</dg:DataGridCheckBoxColumn>
</dg:DataGrid.Columns>
</dg:DataGrid>
謝謝,我不介意他們是否必須直接點擊chcekbox。我不想要的是必須讓重點能夠點擊它。 – 2009-10-01 12:59:59