Version

Filtering

Topic Overview

Purpose

This topic provides reference information about the recordable user methods for testing the filtering in xamDataPresenter™ controls.

Recordable Methods

Recordable methods summary chart

The following table briefly explains the recordable methods for testing the control. Detailed information about the methods is provided in the text blocks following the table.

Method Description

ClearRecordFilters

Clears all filters for a specified record.

OpenCustomFilterDialog

Opens the Custom Filter Selection dialog when the user chooses the (Custom) option from the filter menu.

SelectFilter

Selects a filter value from the filter icons.

SetFilterCellCompOperator

Sets a comparison operator in the specified filter cell.

ClearRecordFilters

Description

The ClearRecordFilters method is used for recording and replaying the clearing of all filters for a specified record. This method records the clicking of the Clear button positioned on the left in xamDataGrid control.

Details

When replaying, this method performs some validations first and then clears all record filters:

  1. Validating the specified record path

  2. Clearing the filters’ values

The method accepts the record path as a parameter.

The record path is formed in the following way:

  • root record number

  • {root record number}{parent record number}

  • {root record number}{parent record number}{child record number}

Parameters

The following table explains the method’s parameters along with some sample code.

Method parameter Description

Record path

Using the record path as a parameter.

Example

Setting filter for two fields – supplier and amount and clearing all the filters for the specified FILTER record after that:

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").SetCellData "{FILTER}[supplier]", "Supplier 1"

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").SetCellData "{FILTER}[amount]", "62"

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").ClearRecordFilters "{FILTER}"

Default setting

No default setting.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

The following record was not found.

The record cannot be located when replaying the method.

The record doesn’t exist or is hidden.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

OpenCustomFilterDialog

Description

The OpenCustomFilterDialog method is used for recording and replaying the opening of the Custom Filter Selection dialog. This dailog appears when a user chooses the option (Custom) from the filter menu for a specified field.

Details

This method takes a header path as a required parameter.

The path is formed by concatenating the record path and the field name or field index (the parenthesis and the brackets are part of the syntax):

{record path}[field name or field index]

For example, the cross-section of the first record and the field name is denoted as {0 }[ name], the cross-section of the first child record of the first record and the field name is denoted as {0}{0}[name] .

Parameters

The following table explains the method’s parameters along with some sample code.

Method parameter Description

Header path

Using the header path as a parameter.

Example

Opening the Custom Filter Selection dialog for amount field:

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").OpenCustomFilterDialog "{FILTER}[amount]"

Default setting

No default setting.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

The following record was not found.

The record cannot be located when replaying the method.

The record doesn’t exist or is hidden.

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

Filtering not allowed on the supplied field.

The filtering cannot be performed when replaying the method.

Filtering is disabled.

SelectFilter

Description

The SelectFilter method is used for recording and replaying data filtering through the filter icons (when the xamDataPresenter property FilterUIType is set to LabelIcons ).

Details

The method accepts as parameters the header path and a value from the filter drop-down list.

Parameters

The following table explains the method’s parameters along with some sample code.

Method parameter Description
  • Header path

  • Option from the filter drop-down menu

Using the header path and an option from the filter drop-down menu as parameters.

Example

Choosing the option David McCullough from the filter drop-down menu and filtering the data in the Author field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").SelectFilter "{0}{0}[Author]", "David McCullough"

Default setting

No default setting.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

This action can only be used with the FilterUI Type [LabelIcon]

The FilterUIType is not correctly set.

The FilterUIType is not set to LabelItems.

The following item was not found.

The specified item cannot be located when replaying the method.

The method parameter is not correct.

SetFilterCellCompOperator

Description

The SetFilterCellCompOperator method is used for recording and replaying setting a comparison operator in the specified filter cell.

Details

The method takes the filter cell path and a comparison operator as parameters.

The different operators are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

The following table explains the method’s parameters along with some sample code.

Method Parameter Description
  • Cell path

  • Comparison operator

Using the cell path and a comparison operator as parameters.

Example

Setting a comparison operator igContains to the “Author” field:

WpfWindow("MainWindow").XamDataGrid("dataGrid").SetFilterCellCompOperator "{0}{FILTER}[Author]", igContains

Default setting

No default setting.

Possible exceptions

The following table lists the possible exceptions for the method and the reason that is likely to be causing them.

Exception name Exception description Possible reasons

The argument is malformed.

The parameter is not format correctly.

The method parameter is not correctly formatted.

The following item was not found.

The specified cell cannot be located when replaying the method.

The method parameter is not correct.

Related Content

Topics

The table below lists other topics you may find useful.

Topic Purpose

This topic provides reference information about the recordable user methods for testing the editing in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the navigation and selection actions in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the sorting and grouping user actions in xamDataPresenter™ controls.

This topic provides reference information about the recordable user methods for testing the summary feature in xamDataPresenter™ controls.