What's the easiest way to convert a BindingList<T> to a T[] ?
EDIT: I'm on 3.0 for this project, so no LINQ.
Well, if you have LINQ (C# 3.0 + either .NET 3.5 or LINQBridge) you can use .ToArray() - otherwise, just create an array and copy the data.
T[] arr = new T[list.Count];
list.CopyTo(arr, 0);
In .Net 2 you have to use .CopyTo() method on your BindingList<T>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With