<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False"> <ig:XamGrid.SelectionSettings> <ig:SelectionSettings CellSelection="Multiple" ColumnSelection="Multiple" RowSelection="Multiple"/> </ig:XamGrid.SelectionSettings> … </ig:XamGrid>
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.
The selection feature enables the selection of rows, cells, and columns of xamGrid™. Once selection is enabled, you must set various properties to configure the type of selection you want. Your end user can select cells in a continuous block or range as well as a non-continuous block.
By default, selection is not enabled on the xamGrid control. To enable selection for cells, rows and columns you can set the following properties on the SelectionSettings object to a value of the SelectionType enumeration:
CellSelection – Enables cell selection on xamGrid.
ColumnSelection – Enables column selection on xamGrid.
Row Selection – Enables row selection on xamGrid.
With single selection enabled, your end user can only select one cell, column or row at a time.
With multiple selection enabled, your end users can select multiple cells, columns or rows in the following way:
Click a column’s header to select it.
Click and drag for multiple, continuous selection.
SHIFT+Click for multiple, continuous selection.
CTRL+Click for multiple, discontinuous selection.
The SelectionSettings object’s CellClickAction property determines if a row or cell will be selected when a click action occurs. By default this is set to SelectCell.
The following code demonstrates how to enable cell, column and row selection on your xamGrid control.
In XAML:
<ig:XamGrid x:Name="MyGrid" AutoGenerateColumns="False"> <ig:XamGrid.SelectionSettings> <ig:SelectionSettings CellSelection="Multiple" ColumnSelection="Multiple" RowSelection="Multiple"/> </ig:XamGrid.SelectionSettings> … </ig:XamGrid>
In Visual Basic:
Imports Infragistics.Controls.Grids ... Me.MyGrid.SelectionSettings.CellSelection = SelectionType.Multiple Me.MyGrid.SelectionSettings.ColumnSelection = SelectionType.Multiple Me.MyGrid.SelectionSettings.RowSelection = SelectionType.Multiple
In C#:
using Infragistics.Controls.Grids; ... this.MyGrid.SelectionSettings.CellSelection = SelectionType.Multiple; this.MyGrid.SelectionSettings.ColumnSelection = SelectionType.Multiple; this.MyGrid.SelectionSettings.RowSelection = SelectionType.Multiple;