Version

Sorting and Grouping

Topic Overview

Purpose

This topic provides reference information about the recordable user methods for testing the sorting and grouping user actions 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

CollapseGroupField

Collapse the specified FieldGroup.

ExpandGroupField

Expand the specified FieldGroup.

GroupByField

Groups the data by the specified field.

SortField

Sorts the specified field.

UnGroupField

Groups the data by the specified field.

CollapseGroupField

Description

The CollapseGroupField method is used for recording and replaying of GroupField collapsing.

Details

The method accepts as a parameter the name of the GroupField to be collapsed and the index of the field layout in which it is located.

Parameters

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

Method parameter Description
  • sGroupFieldName

  • iFieldLayoutIndex

The parameters are: name of the GroupField and the index of the field layout which contains the GroupField.

Example

WpfWindow("MainWindow").XamDataPresenter("xamDP").CollapseGroupField "Player", 0

Default setting

No default setting.

Possible exceptions

No known exception.

ExpandGroupField

Description

The ExpandGroupField method is used for recording and replaying of GroupField expanding.

Details

The method accepts as a parameter the name of the GroupField to be expanded and the index of the field layout in which it is located.

Parameters

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

Method parameter Description
  • sGroupFieldName

  • iFieldLayoutIndex

The parameters are: name of the GroupField and the index of the field layout which contains the GroupField.

Example

WpfWindow("MainWindow").XamDataPresenter("xamDP").ExpandGroupField "Player", 0

Default setting

No default setting.

Possible exceptions

No known exception.

GroupByField

Description

The GroupByField method is used for recording and replaying the grouping of data by a specified field performed by the user.

Details

This method takes a header path and the position of the grouping indicator in the group-by area as required parameters.

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

{record path}[field name or field index]

For a field identification can be used either the field header 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

(required)

  • Group-by indicator position in the group-by area

Using the header path and its position in the group-by area as parameters.

Example

Grouping by the name field; the group-by indicator is placed at the first position in the group-by area.

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").GroupByField "{0}[name]", 0

The first grouped record is expanded and grouping by the description field is performed next. The description group-by indicator is placed at the second position after the name group-by indicator.

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").ExpandRecord "{0}"

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").GroupByField "{0}{0}[description]", 1

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 items have not been found.

The specified item(s) cannot be located when replaying the method.

The path to the selected item is not correct.

The argument is malformed.

The parameter is not formatted correctly.

The method’s parameter is not formatted correctly.

Group-by support is not enabled.

The grouping fails when replaying the method.

The Group-by functionality is disabled.

The group-by position is out of range.

The group-by indicator cannot be positioned when replaying the method.

The group-by indicator position is not correct.

SortField

Description

The SortField method is used for recording and replaying the sorting of a specified field.

Details

This method takes the field’s path and the sort order as required parameters. There is also one optional Boolean parameter which is used when sorting of multiple fields is performed.

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

{record path}[field name or field index]

For a field identification can be used either the field header 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] .

The sort order parameters are listed in the xamDataPresenter - Enumeration Reference topic.

Parameters

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

Method parameter Description
  • Field path

(required)

  • Sort direction

(required)

  • True

The field path can be either the field title or field index.

The sort order can be either ascending/descending or not specified.

The True parameter indicates that more than one field is sorted. It is omitted when only one field is sorted.

Example

Performing a multiple fields sorting:

  • the Title field is sorted descending

  • hold the CTRL key to sort another field

  • the Author field is sorted ascending

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").SortField "[Title]", igDescending

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").SortField "[Author]", 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 following items have not been found.

The specified item(s) cannot be located when replaying the method.

The path to the selected item is not correct.

The argument is malformed.

The parameter is not formatted correctly.

The method’s parameter is not formatted correctly.

Sorting not enabled for the supplied field.

Sorting cannot be performed when replaying the method.

The Sorting functionality is disabled.

UnGroupField

Description

The UnGroupField method is used for recording and replaying the ungrouping of data.

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 index (the parenthesis and the brackets are part of the syntax):

{record path}[field name or field index]

For a field identification can be used either the field header 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

Ungrouping the data by the description field.

WpfWindow("MainWindow").XamDataGrid("XamDataGrid1").UnGroupField "{0}{0}{0}[description]"

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 items have not been found.

The specified item(s) cannot be located when replaying the method.

The path to the selected item is not correct.

The argument is malformed.

The parameter is not formatted correctly.

The method’s parameter is not correctly formatted.

The Group-by support is not enabled.

The grouping fails when replaying the method.

The Group-by functionality is disabled.

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 filtering 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 summary feature in xamDataPresenter controls.