Table of Contents

ItemSelectionChanging

This rule is triggered before the selection state of an item is changed.
This happens when :

  • the user clicks on the selection column of row in a data grid
  • when calling the SelectAllItemsAsync, SelectItemAsync, UnselectAllItemsAsync or UnselectItemAsync methods

This rule is triggered before the selection state of an item is changed (by code or using the selection column of a datagrid).

See this article for more information on event rules execution order.

Arguments

The Arguments property provides the following options.

Name Type Description
Item The type of the UI view model Instance of the item to whose selection is changing.
Cancel bool If set to true, the selection will stay at its current state.

Item versus DatasourceCurrent

Item refers to the item being (un)selected. It is the same as using Arguments.Item.

Important

The current position can be completely different from the position of the item being selected, therefore, never assume that DatasourceCurrent refers to the item being selected.

To know more on the difference between the Item and DatasourceCurrent properties in an UI view event rule, you can check this article.