Hi Emil,
Thanks for contacting Syncfusion Support.
Your requirement to have a floating button over the datagrid and to handle its visibility based on the scrolling of the datagrid can be achieved by using the ScrollRows_Changed event of the VisualContainer. Please refer the below code example to achieve your requirement.
dataGrid.GridLoaded += DataGrid_GridLoaded;
private void DataGrid_GridLoaded(object sender, GridLoadedEventArgs e)
{
container = dataGrid.GetType().GetTypeInfo().GetDeclaredProperty("VisualContainer").GetValue(dataGrid) as VisualContainer;
container.ScrollRows.Changed += ScrollRows_Changed;
}
private void ScrollRows_Changed(object sender, ScrollChangedEventArgs e)
{
if (previousOffset > 0)
{
if (previousOffset > container.VerticalOffset)
button.IsVisible = false;
else
button.IsVisible = true;
}
else
{
button.IsVisible = false;
}
previousOffset = container.VerticalOffset;
} |
We have prepared a sample to achieve your requirement, you can download the same from the below link.
Regards,
Suhasini