Deividas Kiznis
Deividas Kiznis

Reputation: 72

c++ add new row datagridview

I'm using Visual Studio c++ forms. I took default datagridview from a tool box, and changed nothing from options. whenever I run program I get error message 'System.ArgumentOutOfRangeException', because not creating a new row to a table.

for (int i = 0; i < 3; ++i) {
 datagridview->Rows[i]->Cells[1]->Value = i; }

Upvotes: 0

Views: 4799

Answers (1)

Deividas Kiznis
Deividas Kiznis

Reputation: 72

I simply needed add this line of code which create new row:

datagridview->Rows->Add();

Upvotes: 1

Related Questions