Binding DataGrid to an Array

A

Alan Gillott

Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
Collection? I know Linq can in vb2008 but I don't want to download 2008 just
yet.
Lots of examples binding text boxes to Id arrays or DataGrids to Databases
but I can't quite get my head around what to do for datagrid to Array.
A
 
A

Alan Gillott

Alan Gillott said:
Is it possible to bind a Datagrid to a 2 dimentional Array? Or even a
Collection? I know Linq can in vb2008 but I don't want to download 2008
just yet.
Lots of examples binding text boxes to Id arrays or DataGrids to Databases
but I can't quite get my head around what to do for datagrid to Array.
A
 
B

Bob Powell [MVP]

You can bind to a collection of simple values in which case you get a single
column of editable data.

You can bind to a collection of objects in which case the grid will try to
define columns based on the names of the properties in the objects and use
them for column names.

You cannot bind to a two dimentional array of, say, integers.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top