public void AddNewItem_Click(object sender, EventArgs e) { CustomerDialog dialog = new CustomerDialog(); if (dialog.ShowDialog() == DialogResult.Cancel) { this.Customer.Items.RemoveAt(this.Customer.Items.Count - 1);// Error return; } Data.VMSDataSet.CustomerRow row = this.VMSDataSet.Customer.NewCustomerRow(); row.FirstName = dialog.FirstName; row.LastName = dialog.LastName; this.VMSDataSet.Customer.Rows.Add(row); }
this.GridView.Rows.RemoveAt(this.GridView.Rows.Count - 1);
RemoveAt
0 .. Count-1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)