WPF的DataGrid - 如何把注意力集中在DataGrid的底部添加新行?注意力集中、WPF、DataGrid

2023-09-04 10:40:44 作者:从黄昏到繁星点点

我使用 的DataGrid 从 WPF工具包和我需要能够维持焦点在网格的底部(即最后一行)。我在现在的问题是,作为行被添加滚动条为的DataGrid 不与被添加的新行一起滚动。什么是实现这一目标的最好方法是什么?

I am using DataGrid from the WPF Toolkit and I need to be able to maintain focus on the bottom of the grid (i.e. the last row). The problem I'm having right now is that as rows are added the scrollbar for the DataGrid doesn't scroll along with the new rows being added. What's the best way to accomplish this?

推荐答案

看起来像DataGrid.ScrollIntoView(<item>)将继续把重点放在底部的的DataGrid