ttugates 0 Newbie Poster

Hi,

I am writing a program that displays a 2D array of strings, (non jagged) onto a windows form using Visual Studio 2010 and C#.

For example:

string[,] fds = new string[,] {{"ant", "aunt"}};

I attempted using the dataGridView controll,

dataGridView1.DataSource = fds;

but, get the length of the value, and not the value, after research find that dataGridView is not specifically for arrays. Also get an error about the array being 'array was not a one demensional array.'
ListBox seems to be 1D only as well..

What approach or Controll is best suited to display in a form, in a 'grid' that is 2D and later implement sorting when columns are clicked? Thanks...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.