Is there a DataGrid event "rendering completed"?

When I load my DataGrid, I change the cursor to a wait icon, load the data into my ItemSource from the database, and then return it to default. This works fine, except for the fact that there is a delay between when the ItemsSource is populated and when the DataGrid actually displays the data, so the cursor reverts to the default again.

Is there an event that fires when the DataGrid is fully executed so that my cursor can return to default at the right time?

+5
source share
1 answer

FrameworkElement.Loaded event

Occurs when an item is laid out, displayed, and ready for interaction.

Edit

Or, immediately after changing the DataSource, do the following. That way, it will reset the cursor when the application is down.

Dispatcher.InvokeAsync(() => { System.Windows.Input.Mouse.OverrideCursor = null; }, DispatcherPriority.ApplicationIdle); 
+2
source

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


All Articles