Changing Field, Record, or Cell Selection Behavior

Glossary Item Box

Infragistics(R) NetAdvantage(R) for WPF

Changing Field, Record, or Cell Selection Behavior

You can modify xamDataCarousel™, xamDataGrid™, and xamDataPresenter'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 Creating xamDataGrid in XAML. 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: 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>
    

  2. 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.

E-mail your feedback on this topic.

Opinion about our help? Take our survey.

Copyright © 2003-2007 Infragistics, Inc. All rights reserved.

Build Version: 7.1.20071.1320