How do i add a row to a data source (datagridview)?
dataGridView1.Rows.Add(textBox2.Text, textBox1.Text);
that gives me an error saying:
Rows cannot be programmatically added to the DataGridView's rows collection when the control is data-bound.
my datasource:
XmlDataDocument xmlDatadoc = new XmlDataDocument();
xmlDatadoc.DataSet.ReadXml("Filepath");
DataSet ds = new DataSet("Books DataSet");
ds = xmlDatadoc.DataSet;
dataGridView1.DataSource = ds.DefaultViewManager;
dataGridView1.DataMember = "Shortcut";