GridViewControl [Archive] - C Board

PDA

View Full Version : GridViewControl


Coding
03-29-2008, 12:49 PM
I am using a "GridViewControl" with 14 columns and with this code below I can set the number "1" to the First Column and 21 Rows down.
What I wonder is how I access for example column 3 and row 1 or column 4 and row 2 etc...
What is the way/syntax to do this ?
I am not sure wich one of all column.. members to use here.


String^ Numbers = "1";

for( int i = 0; i < 20; i++)
{
MainResultGrid->Rows->Add(Numbers);
}

Magos
03-29-2008, 02:16 PM
I can't really make out what you're asking, but if you're trying to access the cell at a specific row and column you could use something this:

int Row = 12;
int Column = 34;
dataGridView1.Rows[Row].Cells[Column].Value = "Hello";

Coding
03-29-2008, 02:29 PM
Great thanks, that was exactly what I was looking for and it works fine.