Version

Sorting and Grouping

Topic Overview

Purpose

This topic provides reference information about the recordable user methods related to the testing of the sorting and grouping in the xamGrid™ control.

In this topic

This topic contains the following sections:

Recordable Methods

Methods reference summary chart

The following table summarizes the purpose and functionality of the recordable methods for testing the sorting and grouping in the xamGrid control.

Method Description

Groups the data by a specified column.

Sorts the data by a specified column.

Ungroups the data by a specified column.

GroupByColumn

Description

The GroupByColumn method records and replays the grouping of data by a specified column.

Details

The GroupByColumn method is recorded in a test when:

  1. The xamGrid data is grouped by a column.

  2. Multiple-column grouping is performed by dragging column headers to other positions in the group B y area.

When replaying the method:

  1. The specified column header is verified.

  2. A check is performed to verify that grouping is allowed for the specified column.

  3. A check is performed to verify that the groupBy area is visible.

  4. The specified groupBy column header position in the groupBy area is verified.

  5. The grouping is performed.

The method accepts as parameters the column header name or the column header index in the groupBy area when multiple columns grouping is performed.

Parameters

The following table maps the desired configuration to its parameters’ settings.

In order to: Use this parameter: And set it to:

Specify the grouping column by name

sHeaderArg

The column header name

Specify the position of the grouping column

iPosition

The position of the header (integer)

Example

Grouping data in the xamGrid by the Company column.

WpfWindow("WPFApplication1").XamGrid("xamGrid1").GroupByColumn "[Company]", 0

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’s format is incorrect.

The method’s parameter is not in a valid format.

The following item was not found.

The specified item cannot be located when replaying the method.

The method’s parameter is not correct.

The element is not visible.

The item is not visible and replaying the method fails.

The item on which the action is performed either doesn’t exist or is hidden.

The grouping position is out of range.

The specified position is not valid and replaying the method fails.

The specified position index is not in the valid range.

GroupBy support is not enabled.

The groupBy feature is not enabled and replaying the method fails.

The groupBy feature is not allowed, either for the entire grid or for the specified column.

SortColumn

Description

The SortColumn method records and replays the sorting of data by a specified column.

Details

The SortColumn method is recorded in a test when the column header is clicked and sorting is performed.

When replaying the method:

  1. The specified column header is verified.

  2. The specified sorting direction is verified.

  3. A check is performed to verify that checked if sorting is enabled.

  4. Sorting is performed.

The method accepts as parameters the column header name, the sorting direction, and a boolean parameter that indicates whether multiple-column sorting is performed.

The sorting direction options are listed in the xamGrid - Enumeration Reference topic.

Parameters

The following table maps the desired configuration to its parameters’ settings.

In order to: Use this parameter: And set it to:

Specify the sort column

oColumn

The column header

Specify the sorting direction

oSortDirection

  • igAscending

  • igDescending

  • igNotSorted

Specify the sorting type (single-column or multiple-column)

bExtendSort

  • True

  • False

  • Empty (by default)

Example

Performing multiple xamGrid data sorting – first (primary) sorting by the CustomerID column and then sorting of the Company and ContactName columns.

WpfWindow("WPFApplication1").XamGrid("xamGrid1").SortColumn "[CustomerID]",igAscending
WpfWindow("WPFApplication1").XamGrid("xamGrid1").SortColumn "[Company]",igAscending, True
WpfWindow("WPFApplication1").XamGrid("xamGrid1").SortColumn "[ContactName]",igAscending, True

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’s format is incorrect.

The method’s parameter is not in a valid format.

The following item was not found.

The specified item cannot be located when replaying the method.

The method’s parameter is not correct.

Sorting not enabled for the supplied column.

Sorting is not enabled for the specified column and replaying the method fails.

Sorting is disabled for the specified column.

The option supplied is not one of the valid options.

One or more of the supplied parameters is not valid and replaying the method fails.

One or more of the supplied parameters is not valid.

Extended sorting is not allowed for the supplied column.

Multiple column sorting is not enabled and replaying the method fails.

The multiple column sorting is not enabled for the grid.

The element is not visible.

The item is not visible and replaying the method fails.

The item on which the action is performed either doesn’t exist or is hidden.

The point required to perform the operation is not visible.

The point required to perform the operation is not visible and replaying the method fails.

The point required to perform the operation is not visible.

UnGroupColumn

Description

The UnGroupColumn method records and replays the ungrouping of data by a specified column if grouping action by this column has been previously performed.

Details

When replaying the method:

  1. The specified column header is verified.

  2. A check is performed to verify that grouping is allowed for the specified column.

  3. A check is performed to verify that the groupBy area is visible.

  4. Ungrouping is performed.

The method accepts as a parameter the column header.

Parameters

The following table maps the desired configuration to parameters settings.

In order to: Use this parameter: And set it to:

Specify the ungrouping column by name

sHeaderArg

The column header

Example

Ungrouping data in the xamGrid by the Company column.

WpfWindow("WPFApplication1").XamGrid("xamGrid1").UnGroupColumn "[Company]"

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’s format is incorrect.

The method’s parameter is not in a valid format.

The following item was not found.

The specified item cannot be located when replaying the method.

The method’s parameter is not correct.

The element is not visible.

The item is not visible and replaying the method fails.

The item on which the action is performed either doesn’t exist or is hidden.

GroupBy support is not enabled.

The groupBy feature is not enabled and replaying the method fails.

The groupBy feature is not allowed, either for the entire grid or for the specified column.

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides reference information about the recordable user methods related to the testing of the display features in the xamGrid control.

This topic provides reference information about the recordable user methods related to the testing of the editing in the xamGrid control.

This topic provides reference information about the recordable user methods related to the testing of the filtering in the xamGrid control.

This topic provides reference information about the recordable user methods related to the testing of the navigation and selection in the xamGrid control.

This topic provides reference information about the recordable user methods related to the testing of the summaries in the xamGrid control.