Version

Working with Selected Data Items (xamDataGrid)

Topic Overview

Purpose

This topic explains how to access the xamDataGrid’s selected items.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

This topic introduces the xamDataGrid control and various elements, on which control is composed.

This topic provides overview information about the selection of the data presenter’s cells, rows and fields.

In this topic

This topic contains the following sections:

Introduction

Selected data items summary

The SelectedDataItems property of the xamDataGrid allows you to set or obtain an array of the currently selected items. You can bind to this property and operate with xamDataGrid selection while creating MVVM design pattern applications.

Note
Note

The items in the SelectedDataItems array are the actual data items from the underlying data source.

This property is exposed so that applications can “two-way” bind to it (which is its default binding mode) to select the associated DataRecords and/or be notified when the user selects cells and/or records. This behavior is determined by the SelectedDataItemsScope property which is explained below.

You can also use the SelectedDataItem property to get or set the last selected item of the xamDataGrid .

Selection Scope Configuration Summary

Selection configuration summary chart

Task * Value*

The user selection not to have any impact on the SelectedDataItems property.

None (default)

The user record selection only to be included in the SelectedDataItems property.

The user record or cell selection to be included in the SelectedDataItems property.

Note
Note

Each time the user switches between record selection and cell selection this will clear the previous selected items and begin new selection.

Note
Note

If the SelectedDataItemsScope property is changed from its default value of None then every time the user changes selection the SelectedDataItems property will be set to a new array of data items based on the behavior described in the above table.

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic explains how to define and configure field’s presentation in the control.