[c#] Dynamically adding rows to DataGridView
I am using a DataGridView in my app. How do I add a new row to the already existing dataset?
I see tons of web control stuff, but nothing on window forms...
I attempted this code
dataGridView1.Rows.Add(new string());
When I run this code, it is giving the following exception:
exception: rows cannot be added programatically to the datagridview's collection when control is databound.
Tell me there is a way to add rows to a DataGridView dynamically, since you can in C++.
|