Version

Cell and Record Selection

This topic will walk you through the process of configuring cell and record selection in the XamDataGrid control.

In this topic

This topic contains the following sections:

Required Background

The following topics are prerequisites to understanding this topic:

Topic Purpose

Getting Started With XamDataGrid

This topic provides basic steps required for adding the XamDataGrid control to your view and populating it with sample data.

Working with Columns

This topic provides code examples on working with columns in the XamDataGrid control.

Overview

The XamDataGrid control supports the ability to change how the selection is handled.

Selection in the data grid is enabled on a row and cell level and can be configured by using the SelectionMode option of the grid. This property takes five different options, listed below:

Note, cells and rows selection cannot be enabled together, only separately.

  • SingleCell - Selection of a single cell is enabled.

  • SingleRow - Selection of a single row is enabled.

  • MultipleCell - Selection of multiple cells is enabled.

  • MultipleRow - Selection of multiple rows is enabled.

  • RangeCell - Selection of a range of multiple cells by clicking and dragging is enabled. When set to MultipleRow or MultipleCell, it is not necessary to hold the CTRL key to select multiple rows or cells. Each row or cell will be selected or deselected on click of that particular row or cell.

  • None - Disables cell and row selection.

In XAML:

xmlns:ig="clr-namespace:Infragistics.XamarinForms.Controls.Grids;assembly=Infragistics.XF.DataGrid"
...
<ig:XamDataGrid SelectionMode="SingleCell">
</ig:XamDataGrid>

In C#:

XamDataGrid grid = new XamDataGrid() {
        SelectionMode = GridSelectionMode.SingleCell
};

Related Content

The following table lists topics that are related to this topic:

Topic Purpose

Row Grouping

This topic provides code examples on grouping rows in the XamDataGrid control.