Windows:UWP中的ScrollViewer不能与datagrid结合使用

时间:2019-06-16 18:09:19

标签: c# xaml uwp datagrid scrollviewer

我正在尝试创建ScrollViewer,但是当我使用ScrollViewer时它不会滚动 鼠标滚轮,我不知道我做错了什么:/

我使用最新的Windows(Windows 10 1903-可能会更新)

我的XAML页面:

<RelativePanel x:Name="RelativePanel">
        <ScrollViewer VerticalScrollBarVisibility="Auto">
            <Grid
            Margin="0,0,0,0"
            RelativePanel.AlignLeftWithPanel="True"
            RelativePanel.AlignRightWithPanel="True">

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>

                <toolkit:DataGrid
                x:Name="DataGrid"
                CanUserReorderColumns="False"
                RowDetailsVisibilityMode="VisibleWhenSelected"
                AutoGenerateColumns="False"
                GridLinesVisibility="Horizontal"                        
                PreparingCellForEdit="DataGrid_PreparingCellForEdit"
                RightTapped="DataGrid_RightTapped"
                ContextFlyout="{StaticResource DataGridContextMenu}"
                Margin="20,127,10,-182"
                Grid.ColumnSpan="3">

                    <toolkit:DataGrid.Columns>
                        <toolkit:DataGridTextColumn
                        Header="Name"
                        Binding="{Binding DataGridName}"/>
                        <toolkit:DataGridTextColumn
                        Header="Aktivierungstaste"
                        Binding="{Binding DataGridButtonToEnable}"/>
                        <toolkit:DataGridTextColumn
                        Header="Klicktaste"
                        Binding="{Binding DataGridButtonToClick}"/>
                        <toolkit:DataGridTextColumn
                        Header="Klicks pro Sekunde"
                        Binding="{Binding DataGridCps}"/>
                        <toolkit:DataGridTextColumn
                        Header="Abweichung"                            
                        Binding="{Binding DataGridRandom}"/>
                    </toolkit:DataGrid.Columns>
                </toolkit:DataGrid>
            </Grid>
        </ScrollViewer>
    </RelativePanel>

0 个答案:

没有答案