我有一个使用从数据库中检索到的数据填充的数据网格。不幸的是,当检索到的行数超过数据网格的高度时,即使显示了两个滚动条,我也无法垂直或水平滚动。
这是我的代码:
<data:DataGrid x:Name="DataGrid_Transactions" AutoGenerateColumns="False" VerticalAlignment="Center" Height="300" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" Background="#FF0F1111" FontSize="26" Foreground="RoyalBlue" HorizontalGridLinesBrush="AliceBlue" IsReadOnly="True" VerticalGridLinesBrush="AliceBlue" AlternatingRowBackground="AliceBlue" FontFamily="Segoe WP SemiLight" RowDetailsVisibilityMode="Visible" RowBackground="AliceBlue">
<data:DataGrid.Columns>
<data:DataGridTextColumn Header="Transaction ID" Binding="{Binding TransactionID}" />
<data:DataGridTextColumn Header="Vendor Username" Binding="{Binding VendorUsername}" />
<data:DataGridTextColumn Header="Purchase Description" Binding="{Binding PurchaseDescription}" />
<data:DataGridTextColumn Header="Total Price" Binding="{Binding TotalPrice}" />
<data:DataGridTextColumn Header="Currency" Binding="{Binding Currency}" />
</data:DataGrid.Columns>
</data:DataGrid>
<Button Content="Main Page" Height="72" HorizontalAlignment="Center" Margin="0,540,0,43" Name="Button_MainPage" VerticalAlignment="Center" Width="456" Click="Button_MainPage_Click" />
</Grid>
</Grid>
有人可以帮帮我吗?谢谢 :)