I have a function that creates a grid, and I needed to know the value of the scroll of this grid, so I can trigger an event when it reaches the bottom of the page. But I do not know how to get those values, the function is down here:
using System.Windows.Controls;
public override FrameworkElement criar()
{
if (formulario == null)
return null;
DataGrid grid = new DataGrid();
ContextMenu menu = new ContextMenu();
definirStyle(grid, "tema.estiloGradeDados");
definirBinding(grid, DataGrid.ItemsSourceProperty, "dados", true);
grid.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
grid.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
grid.GroupStyle.Add(new GroupStyle() {ContainerStyleSelector = new SeletorEstiloItemGrupo() });
grid.ContextMenu = menu;
grid.Height = 800;
foreach (DskCampo campo in dskFormulario.campos)
{
criarItemMenu(menu, campo);
criarColuna (grid, campo);
}
return grid;
}
The scroll of the DataGrid descends from "ScrollViewer" not? how do I manipulate it?