Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Row Deletion

The xamGrid™ control allows row deleting using the keyboard Delete key. Once a row is deleted, the underlying data record is also removed. Set the DeleteKeyAction property to enable/disable this feature.

Note
Note:

This behavior requires that your data source implements the IList interface.

The property takes the following DeleteKeyAction Enumeration:

  • None

  • DeleteSelectedRows - Requires row selection enabled.

  • DeleteRowOfActiveCell - Requires an active cell.

  • DeleteRowsOfSelectedCells - Requires cell selection enabled.

  • DeleteRowsOfSelectedCellsAndRows - Requires cell selection or row selection enabled.

The following code shows you how to enable row deletion.

In XAML:

<ig:XamGrid x:Name="xamGrid1" DeleteKeyAction="DeleteRowOfActiveCell"             ItemsSource="{Binding Source={StaticResource DataUtil}, Path=CategoriesAndProducts}" />

In Visual Basic:

Me.xamGrid1.DeleteKeyAction = Infragistics.Controls.Grids.DeleteKeyAction.DeleteRowOfActiveCell

In C#:

this.xamGrid1.DeleteKeyAction = Infragistics.Controls.Grids.DeleteKeyAction.DeleteRowOfActiveCell;