tags:

views:

47

answers:

1

I'm reading data out of a binary file into structs in C#. What's the best way to populate a DataGridView with these records? I've only ever used the Binding with actual databases and in fact all the examples I can find cover using flat text files or databases. Should I not be using the DataGridView at all? Should I be creating a DataTable and binding it to the DataGridView?

Thanks.

A: 

I presume you are reading the file into an array of structs or a list of structs. Just bind the array or the list to the DataGridView.

John Saunders
It's just that easy, damn, thanks.
Mark
In many cases with .NET, it's best to try it first. See my answer at http://stackoverflow.com/questions/1144480/what-is-the-most-under-valued-part-of-net/1144504#1144504.
John Saunders