Programmatically displaying a Datagrid column (horizontal scrolling)

I would like to bring the chart into view programmatically. I have many columns, and when they are disconnected from the screen, I would like to select a cell and display this cell, I can select a cell that is disconnected from the screen, and when I scroll horizontally to display the cell, the selected cell.

I know you can do this with rows, like ScrollIntoView, but what about columns?

Has anyone managed to do this? and if so, how :) (of course)

+4
source share
2 answers

Answer: use the datagrid method.

public void ScrollIntoView(object item, DataGridColumn column); 

which takes a column. plain.

+6
source

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

as

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

best,
Quafin

+1
source

Source: https://habr.com/ru/post/1298969/


All Articles