Is it possible to access the horizontal offset, which I can\'t find in the property list of the datagrid ?
Thanks
In XAML
If you want to access to the HorizontalOffset you need to access to the ScrollViewer contained inside the Datagrid
one possible method to access the ScrollViewer is
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(dataGrid1); i++)
{
if (VisualTreeHelper.GetChild(dataGrid1, i) is ScrollViewer)
{
ScrollViewer scroll =
(ScrollViewer)(VisualTreeHelper.GetChild(dataGrid1, i));
Console.WriteLine(scroll.HorizontalOffset);
}
}
Note that scroll.HorizontalOffset
is read-only