I have a DataGridView
binded to a DataTable
(DataTable
binded to database). I need to add a DataRow
to the DataTable
. I'm trying to use the following code:
dataGridViewPersons.BindingContext[table].EndCurrentEdit();
DataRow row = table.NewRow();
for (int i = 0; i < 28; i++)
{
row[i] = i.ToString();
}
But it doesn't work, DataGridView
has never been added a new row. Please, tell me, how can I fix my code?
Thank you in advance.
question from:
https://stackoverflow.com/questions/12642049/how-to-add-new-datarow-into-datatable 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…