C# group list via GetRange
var dataItems = dg.ItemsSource?.Cast<Book>()?.ToList(); List<List<Book>> booksListList = new List<List<Book>>(); for (int i = 0; i < dataItems.Count; i += 10000) { booksListList.Add(dataItems.GetRange(i, Math.Min(10000, dataItems.Count - i))); }