Version

Selection

Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. 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.

Note
Note:

If the SelectionSettings object’s CellClickAction property is set to SelectCell and RowSelection is enabled, the only way to select rows is by using the row selector. For more information see the Row Selector topic.

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;

The following screen shot displays a grid with selection enabled.

Selection