DataGridView

G

Guest

hello there,
this is my first time playing with the DataGridView control.
What I have is an array of integers and i would like them displayed in the
grid.
I would like to have the row headers numbered.

What is the best approach?
Should I try databind?
Is there a property for numbered row headers?
I'm totally at a loss here as i never used DataGrid 1.1 so any pointers in
correct direction would be greatly appreciated.

Thanks for your time
Brian
 
D

Dhanushka Nuwan

Create a DataTable whatever the columns u want to display in the Grid + with
a DataColumn for Row Header. For eg:
table.Columns.Add("ID", typeof(int));
DataColumn[] colArray = new DataColumn[1];
colArray[0].Unique = true;
colArray[0] = table.Columns["ID"];
colArray[0].AutoIncrement = true;

Regards,
Dhanushka
 

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