Describe the bug
MAUI.DataGrid does not internally handle thread synchronization for updates to its data source. When an item is added to the ObservableCollection from a thread different than the UI thread, the DataGrid does not automatically marshal the change back to the UI thread.
Calling MainThread.BeginInvokeOnMainThread when adding a item to the ItemSource collection solves the problem.
To Reproduce
Steps to reproduce the behavior:
Define a DataGrid with a ItemsSourceassociated to an ObservableCollection
Add an Item to the ObservableCollection from another thread, for example with Task.Run(() => itemList.Add(x));
Describe the bug MAUI.DataGrid does not internally handle thread synchronization for updates to its data source. When an item is added to the ObservableCollection from a thread different than the UI thread, the DataGrid does not automatically marshal the change back to the UI thread. Calling
MainThread.BeginInvokeOnMainThread
when adding a item to theItemSource
collection solves the problem.To Reproduce Steps to reproduce the behavior:
ItemsSource
associated to anObservableCollection
ObservableCollection
from another thread, for example withTask.Run(() => itemList.Add(x));
_paginationStepper.IsEnabled
is changed https://github.com/akgulebubekir/Maui.DataGrid/blob/9b24fb19bcb71b05179960ef3d30dedfd2d2f069/Maui.DataGrid/DataGrid.xaml.cs#L1231Expected behavior Either no exception, or explicitly state on the documentation that calling BeginInvokeOnMainThread is necessary.