以编程方式将数据网格列置于视图中(水平滚动)

发布于 2024-08-18 19:15:34 字数 176 浏览 4 评论 0原文

我想以编程方式显示一个专栏。我有很多列,当它们不在屏幕上时,我想选择一个单元格并将该单元格带入视图中,我可以选择一个在屏幕外的单元格,当我水平滚动以使单元格可见时,该单元格被选中。

我知道你可以用行来做到这一点,即 ScrollIntoView 但列怎么样?

有人有幸这样做吗?如果是的话怎么办:)(当然)

I would like to bring a column into view programatically. I have a lot of columns and when they are off screen i would like to select a cell and bring that cell into view, i can select a cell that is off screen and when i horizontal scroll to bring the cell visible the cell is selected.

i know you can do this with the rows, i.e ScrollIntoView but how about columns?

anyone had any luck doing this? and if so how :) (of course)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抚你发端 2024-08-25 19:15:34

答案:使用datagrid方法。

public void ScrollIntoView(object item, DataGridColumn column);

这需要一列。简单的。

Answer : use the datagrid method.

public void ScrollIntoView(object item, DataGridColumn column);

which takes a column. simple.

只怪假的太真实 2024-08-25 19:15:34

aran,假设您想要转到第 30 列,请尝试设置滚动查看器的水平偏移量。

喜欢,

columnCount = 30;
offset = columCount * Columnwidth
scrollViewer.ScrollToHorizontalOffset(offest);

最好,
奎芬

aran, suppose you want to go to 30 th column, try setting the horizontal offset of the scroll viewer.

like,

columnCount = 30;
offset = columCount * Columnwidth
scrollViewer.ScrollToHorizontalOffset(offest);

best,
Quafin

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文