# Insert and Remove Data

* [Methods](https://www.telerik.com/products/wpf/documentation/controls/radvirtualgrid/features/insert-and-remove-data#methods)

* [Events](https://www.telerik.com/products/wpf/documentation/controls/radvirtualgrid/features/insert-and-remove-data#events)

**RadVirtualGrid** exposes an API for inserting and removing rows and columns at given index. This can be achieved through the following methods:

> The methods for removing a row or column cannot be utilized for pinned rows or columns.

## Methods

* **InsertNewRowAtIndex(int index)**: Increases the table capacity by adding a row at given index

* **InsertNewColumnAtIndex(int index)**: Increases the table capacity by adding a column at given index

* **RemoveRowAtIndex(int index)**: Decreases the capacity of the table by removing a row at given index

* **RemoveColumnAtIndex(int index)**: Decreases the capacity of the table by removing a column at given index

> When inserting a row or a column, the control simply increases its capacity. Updating the source collection with this modification needs to be done manually as well.

## Events

Events related to a deletint operation will be raised when the selected indexes are deleted through the **Delete key**.

### Deleting

Raised when the selected indexes of **RadVirtualGrid** are about to be deleted. The **VirtualGridDeletingEventArgs** expose the **Indexes** property.

* **Cancel**: As the event arguments are of type **CancelEventArgs**, the event can be canceled through this property.

* **Indexes**: The selected indexes that are about to be deleted.

**Example 1: Subscribing to the Deleting event**

```C#
private void VirtualGrid_Deleting(object sender, VirtualGridDeletingEventArgs e)
{
}
```

### Deleted

This event is raised when the selected indexes of the control have been deleted. Similarly to the **VirtualGridDeletingEventArgs**, the **VirtualGridDeletedEventArgs** provide the **Indexes property**

* **Indexes**: The selected indexes that have been deleted.

**Example 2: Subscribing to the Deleted event**

```C#
private void VirtualGrid_Deleted(object sender, VirtualGridDeletedEventArgs e)
{
}
```

## See Also

* [Editing](https://www.telerik.com/products/wpf/documentation/controls/radvirtualgrid/features/editing)

* [Pinned Rows and Columns](https://www.telerik.com/products/wpf/documentation/controls/radvirtualgrid/features/pinned-rows-and-columns)
