I tried to achieve this somehow with the detection of the offset, but since the offset is the distance from the left side, I don't how to detect the distance from the right side.
This is what I tried:
private void AllEntries_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
if ( e.HorizontalChange != 0)
{
if (e.HorizontalOffset < 350)
{
//Do something
}
if (e.HorizontalOffset / e.ExtentWidth > 0.9)
{
//Do something
}
}
}
the event in the datagrid:
ScrollViewer.ScrollChanged="AllEntries_ScrollChanged"