Version

Changing Field, Record, or Cell Selection Behavior

You can modify a DataPresenter control’s selection functionality for Cells, Records, and Fields. Use the SelectionType enumeration to choose the selection strategy that best fits your application. Control the selection by setting the SelectionTypeCell, SelectionTypeRecord, or SelectionTypeField property off the FieldLayoutSettings object.

The following procedure assumes you have a data bound xamDataGrid for which you want to change the selection behavior. For more information on data binding xamDataGrid, see Adding xamDataGrid to Your Page. The settings in this procedure would be similar to those of xamDataCarousel and xamDataPresenter.

To change the selection type for cells, records, and fields:

  1. Set the SelectTypeCell and SelectionTypeRecord properties to Extended off the xamDataGrid instance. These properties allow the end user to select multiple cells or records at the same time. Set the SelectTypeField property to Single if you want the end user to select only one field at a time.

    Note
    Note

    The SelectTypeField setting will work only if you already set the LabelClickAction property to SelectField.

    In XAML:

    <igDP:XamDataGrid ... >
        <igDP:XamDataGrid.FieldLayoutSettings>
            <igDP:FieldLayoutSettings
                SelectionTypeCell="Extended"
                SelectionTypeRecord="Extended"
                SelectionTypeField="Single" />
        </igDP:XamDataGrid.FieldLayoutSettings>
    </igDP:XamDataGrid>
  1. Build and run the project. When you select multiple records with either the CTRL or SHIFT keys, the records will be highlighted similar to the image below.

    xamdatagrid with multiple records selected