Table of Contents

ItemRemoving

This rule is triggered before removing an item from the datasource, after the confirmation message has been displayed.
This occurs when :

  • the user clicks on the Remove button
  • DeleteDataAsync or DeleteSelectedItemsAsync are called by code

The rule is triggered after the deletion confirmation message is displayed and the user has confirmed the deletion. By default, this is only the case when deleting an item from the main UI view of a screen.
Check this article to know how to change the behavior of the confirmation message.

When deleting several items at once, the rule is triggered once per deleted item.

Note

When deleting an item of the main UI view of a screen, the DELETE API is immediately called without having to save.

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 being removed.
Cancel bool If set to true, the item will not be removed from the view model datasource and no DELETE API is called.

Item versus DatasourceCurrent

Item refers to the deleted item. It is the same as using Arguments.Item.

Important

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

For example, when deleting several items at once in a data grid, DatasourceCurrent will only refer to one of the items being deleted.

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