In order to remove a single row from RadGridView, you should simply call the the Remove() method and pass an object of type GridViewDataRowInfo as an argument.
Copy[C#] Remove specified row
this.radGridView1.Rows.Remove(rowToRemove);
Copy[VB.NET] Remove specified row
Me.RadGridView1.Rows.Remove(rowToRemove)
If you want to remove a row at a specific position, call RemoveAt() method and pass the row index.
Copy[C#] Remove row at specified position
this.radGridView1.Rows.RemoveAt(0);
Copy[VB.NET] Remove row at specified position
Me.RadGridView1.Rows.RemoveAt(0)
As to removing all rows, make a loop and remove the rows with the RemoveAt() method.
Note: If your RadGridView is bound to a BindingList, the BindingList
will be updated automatically. However, if RadGridView is bound to a database using a typed DataSet
, you should call the Update method of the DataSet's TableAdapter. Here is an example with the NorthWind data set and its carsTableAdapter
Copy[C#]
this.carsTableAdapter.Update(this.nwindDataSet.Cars);
Copy[VB.NET]
Me.CarsTableAdapter.Update(Me.NwindDataSet.Cars)