Search This Blog

Thursday, December 12, 2013

How to delete rows from DataGridView without delete rows from DataTable

C# > System.Data   > DataGridView > Delete rows

How to delete rows from DataGridView without delete rows from DataTable?

Solution

Copy original DataTable

Example:


  DataTable dt1 = dt.Copy();
  dataGridView1.DataSource = dt1;