My C# application binds a grid to a datatable, allows the user to edit the data directly in the grid, then a button click event writes the datatable contents to an XML file. The code below describes the very simple code contained in the click event, which works perfectly. Now I want to provide a checkbox in each row that will allow the user to de-select any records so that they are not to be included in the XML output. Would appreciate help to find the most efficient method of achieving this.
private void simpleButton2_Click(object sender, EventArgs e)
DataTable dt3 = (DataTable)gridControl1.DataSource;
dt3.TableName = "CustomerList";
if (dt3.Rows.Count <= 0)
MessageBox.Show("There are no records available");
dt3.WriteXml(@textBox2.Text + "\\Customer.xml");
MessageBox.Show("Data successfully saved to file");