Skip to content

Commit

Permalink
avoid casting
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Miller committed Mar 23, 2024
1 parent 46166af commit 79231fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Maui.DataGrid/DataGrid.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ private void SortAndPaginate(SortData? sortData = null)

sortData ??= SortedColumnIndex;

var originalItems = ItemsSource.Cast<object>().ToList();
var originalItems = ItemsSource as IList<object> ?? ItemsSource.Cast<object>().ToList();

PageCount = (int)Math.Ceiling(originalItems.Count / (double)PageSize);

Expand Down

0 comments on commit 79231fd

Please sign in to comment.