New to Telerik UI for WinFormsStart a free 30-day trial

Removing Rows

Updated over 6 months ago

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.

Remove Row

C#
this.radGridView1.Rows.Remove(rowToRemove);

If you want to remove a row at a specific position, call RemoveAt method and pass the row index.

Remove Row With Index

C#
this.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 data set, you should call the Update method. Here is an example with the NorthWind data set and its carsTableAdapter

Update Adapter

C#
this.carsTableAdapter.Update(this.nwindDataSet.Cars);

An alternative to removing all the rows would be to use the Clear method of the Rows collection as it will be a more efficient solution since the grid's events will be suspended and you will write less code:

Clearing Rows

C#
this.radGridView1.Rows.Clear();

See Also

In this article
See Also
Not finding the help you need?
Contact Support