DataGrid WPF 中的 OnScrollShow 事件
OnScrollShow event at DataGrid WPF
如何处理DataGrid的滚动显示事件?
我试图找到一些解决方案,但没有一个。
DataGrid
class 没有 OnScrollShow
事件。您可以处理滚动更改时的 ScrollViewer.ScrollChanged
。如果您更具体地了解您要完成的目标,那么也许我们可以建议您如何尝试实现您想要的功能。
为了检测滚动条是否显示,您可以挂钩 LayoutUpdated
event and use the code in this answer 以检测哪些滚动条可见:
ScrollViewer scrollview = FindVisualChild<ScrollViewer>(dataGrid);
Visibility verticalVisibility = scrollview.ComputedVerticalScrollBarVisibility;
Visibility horizontalVisibility = scrollview.ComputedHorizontalScrollBarVisibility;
如何处理DataGrid的滚动显示事件?
我试图找到一些解决方案,但没有一个。
DataGrid
class 没有 OnScrollShow
事件。您可以处理滚动更改时的 ScrollViewer.ScrollChanged
。如果您更具体地了解您要完成的目标,那么也许我们可以建议您如何尝试实现您想要的功能。
为了检测滚动条是否显示,您可以挂钩 LayoutUpdated
event and use the code in this answer 以检测哪些滚动条可见:
ScrollViewer scrollview = FindVisualChild<ScrollViewer>(dataGrid);
Visibility verticalVisibility = scrollview.ComputedVerticalScrollBarVisibility;
Visibility horizontalVisibility = scrollview.ComputedHorizontalScrollBarVisibility;