Version

Editing

Topic Overview

Purpose

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

Recordable Methods

Methods reference summary

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

Method Description

Copies the selected cell(s) to the clipboard.

Exits the Edit mode for the row with or without committing the changes.

Pastes cell(s) from the clipboard into the xamGrid.

Sets Edit mode for the row.

Sets the cell to a specified value.

CopyToClipboard

Description

The CopyToClipboard method copies the selected cell(s) to the clipboard. This action is recorded when the user presses Ctrl-C while at least one cell is selected.

Parameters

This method accepts no parameters.

Example

Copying the data from the selected cells to the clipboard:

WpfWindow("WPFApplication1").XamGrid("xamGrid1").CopyToClipboard

Default setting

No default setting.

Possible exceptions

When XamGrid.ClipboardSettings.AllowCopy == false

Cannot perform the specified action [CopyToClipboard] .

ExitEditMode

Description

The ExitEditMode method is recorded in a test when, after editing a row or a cell, the user accepts the data changes or presses the ESC key to cancel changes.

Details

When replaying the method, the row or cell exits Edit mode.

This method is useful when the entered data is not valid and the update should be canceled.

This method takes a boolean value as a parameter.

Parameters

The following table maps the desired configuration to parameters settings.

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

Exit Edit mode without changing the data (for example - after pressing the ESC button)

bCancel

T rue

Exit Edit mode and accept the data changes

bCancel

False or blank

Example

  • Changing the cell value and canceling the update after that:

WpfWindow("WPFApplication1").XamGrid("xamGrid1").SetCellData "{0}[CustomerID]","BOLID12"
WpfWindow("WPFApplication1").XamGrid("xamGrid1").ExitEditMode True
  • Changing the cell value, accepting changes and exiting from the editing mode:

WpfWindow("WPFApplication1").XamGrid("xamGrid1").SetCellData "{0}[CustomerID]","BOLID12"
WpfWindow("WPFApplication1").XamGrid("xamGrid1").ExitEditMode

Default setting

No default setting.

Possible exceptions

No known exceptions.

PasteFromClipboard

Description

The PasteFromClipboard method pastes the copied cell(s) from the clipboard to the xamGrid. This action is recorded when the user presses Ctrl-V in the xamGrid while at least one cell is in the clipboard.

Parameters

This method accepts no parameters.

Example

Pasting the cells into the xamGrid from the clipboard:

WpfWindow("WPFApplication1").XamGrid("xamGrid1").PasteFromClipboard

Default setting

No default setting.

Possible exceptions

When XamGrid.ClipboardSettings.AllowPaste == false

Cannot perform the specified action [PasteFromClipboard] .

RowEnterEditMode

Description

The RowEnterEditMode method is recorded in a test when a row enters Edit mode.

Details

When replaying the method:

  1. The row address is validated.

  2. The row is set to Edit mode.

The method accepts the row path as a parameter.

The path is formed by concatenating the row paths (the parenthesis are part of the syntax):

{row path}

The path is formed by concatenating together the parent row’ indexes and the target row’s index; the concatenation goes, left to right, in descending hierarchical order, from the root row index down to the sub-row’s indexes and finally to the target row’s index. If the path consists of more than one index, all indexes must be surrounded by parentheses.

For example:

  • The target row is the first root row: 0

  • The target row is the first sub-row of the first root row: {0}{0}

The target row is the third sub-row of the first sub-row of the first root row: {0}{0}{2}

Parameters

The following table maps the desired configuration to parameters settings.

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

Specify the path to a row

oRecordArg

The path to the row in the xamGrid

Example

The first row is editable and a new value is set in the CustomerID column. After that, the row exits Edit mode and changes are accepted.

WpfWindow("WPFApplication1").XamGrid("xamGrid1").RowEnterEditMode 0
WpfWindow("WPFApplication1").XamGrid("xamGrid1").SetCellData "{0}[CustomerID]","TestID"
WpfWindow("WPFApplication1").XamGrid("xamGrid1").ExitEditMode

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

There is no ActiveRow

There is no active row.

No active row is selected.

SetCellData

Description

The SetCellData method is recorded in a test when a value is changed in a xamGrid cell.

Details

When replaying the method:

  1. The provided cell address is validated.

  2. If the cell exists, the cell is is set to Edit mode and then its value is modified.

  3. The cell exits Edit mode.

The method accepts as parameters the cell path and the new value to be set.

The path is formed by concatenating the row path and the column key (the parenthesis and the brackets are part of the syntax):

{row path}[column key]

For example, the cross-section of the first row and the column key is denoted as {0}[key], the cross-section of the first child row of the first row and the column key is denoted as {0}{0}[key].

Parameters

The following table maps the desired configuration to parameters settings.

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

Specify the path to a cell to edit

sCellArg

The path to the cell in the xamGrid

Specify the new value to set

oValue

The new cell value

Example

Setting a new value to the cell in the first row and column CustomerID .

WpfWindow("WPFApplication1").XamGrid("xamGrid1").SetCellData "{0}[CustomerID]", "New Value"

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’s parameter is not correctly formatted.

The following item was not found.

The specified item cannot be located when replaying the method.

The method’s parameter is not correct.

Unable to enter Edit mode.

Editing of the cell is not allowed and the replaying the method fails.

Editing is not enabled.

The element is not visible.

The cell to be edited is not visible and replaying the method fails.

The cell doesn’t exist or is hidden.

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 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 sorting and grouping 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.