ta mu

ta mu

  • NA
  • 201
  • 82.2k

datagridview

Aug 25 2013 8:20 AM
if there are records shown in a data gridview i want to remove them not from database only from datagrieview. on button click event whats wrong with code

// this.dataGridView1.DataSource = null;
            foreach (DataGridViewCell cell in dataGridView1.cells)

{

   cell.Value = null;

}

Error    1    'System.Windows.Forms.DataGridView' does not contain a definition for 'cells' and no extension method 'cells' accepting a first argument of type 'System.Windows.Forms.DataGridView' could be found (are you missing a using directive or an assembly reference?)  

Answers (1)