Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 当按向下箭头键更改行时,Datagrid水平滚动会自动滚动_C#_.net_Wpf_Visual Studio 2010_Datagrid - Fatal编程技术网

C# 当按向下箭头键更改行时,Datagrid水平滚动会自动滚动

C# 当按向下箭头键更改行时,Datagrid水平滚动会自动滚动,c#,.net,wpf,visual-studio-2010,datagrid,C#,.net,Wpf,Visual Studio 2010,Datagrid,我有wpf中的数据网格 我的问题是:当通过箭头键向下更改行时,datagrid的水平滚动条会自动移动 在这方面,我观察到,如果我选择第二列或更多列中的任何记录,则只有水平滚动会自动移动 我使用了: var scp = FindVisualChild<ScrollContentPresenter>(this.dataGridResults); scp.RequestBringIntoView += new RequestBringIntoViewEventHan

我有wpf中的数据网格

我的问题是:当通过箭头键向下更改行时,datagrid的水平滚动条会自动移动

在这方面,我观察到,如果我选择第二列或更多列中的任何记录,则只有水平滚动会自动移动

我使用了:

var scp = FindVisualChild<ScrollContentPresenter>(this.dataGridResults);
            scp.RequestBringIntoView += new RequestBringIntoViewEventHandler(scp_RequestBringIntoView);
但这段代码没有任何效果(调试器出现在这段代码上,但最终滚动条会移动…没有效果)


请帮助我。

查看附加的属性ScrollViewer.HorizontalScrollBarVisibility(如果有帮助)。我附加了,但没有帮助。我也在寻找解决方案,您找到了吗?
void scp_RequestBringIntoView(object sender, RequestBringIntoViewEventArgs e)
        {
                          e.Handled = true  ;
        }