我有两个DataGrid
s:
<DataGrid Name="grdDailyOne"
AutoGenerateColumns="False"
CanUserResizeRows="False"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="True">
<DataGrid.Columns>
<DataGridTextColumn Header="From"
Binding="{Binding From}"
MinWidth="100" />
<DataGridTextColumn Header="To"
Binding="{Binding To}"
MinWidth="100" />
<DataGridTextColumn Header="Elapsed Time"/>
<DataGridTextColumn Header="HDDC Codes"
Binding="{Binding HDDCCode}"
MinWidth="250" />
<DataGridTextColumn Header="Details of Operations in Sequence and Remarks"
Binding="{Binding Details}"
MinWidth="250" />
<DataGridTextColumn Header="Rot Ftg"
Binding="{Binding RotFtg}" />
<DataGridTextColumn Header="Slide Ftg"
Binding="{Binding SlideFtg}" />
</DataGrid.Columns>
</DataGrid>
和
<DataGrid AutoGenerateColumns="False"
Name="grid1"
HorizontalAlignment="Center"
FontSize="25"
Margin="10,20,10,40"
CanUserResizeRows="False"
CanUserResizeColumns="False"
CanUserReorderColumns="False"
CanUserAddRows="False"
CanUserDeleteRows="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Product"
Binding="{Binding Product}" />
<DataGridTextColumn Header="Amount"
Binding="{Binding Amount}" />
<DataGridTextColumn Header="Units"
Binding="{Binding Units}" />
</DataGrid.Columns>
</DataGrid>
现在,在底部的一个,我可以选择行很好,但最上面的一个,我不能。我看了一下,所有的属性都是一样的。我确实知道,我能够这样做,但现在我不是。我需要设置一个我缺少的属性吗?
我尝试过使用SelectionMode="Single" SelectionUnit="FullRow"
,但仍然没有。