Working With Developer Express XtraGrid

Applies to TestComplete 15.63, last modified on April 23, 2024

If you have the Desktop module of TestComplete, you can interact with DevExpress XtraGrid controls from tests. TestComplete provides the DevExpressXtraGrid object that you can use to simulate various user actions over the XtraGrid control, for example, clicking grid cells, getting and setting values in cells, expanding and collapsing rows, and so on.

Because XtraGrid is a .Net control and is used in .NET applications that are always open for TestComplete, the internal methods and properties of the control are also available from tests. You can use these properties and methods to simulate user actions, as well.

Finally, you can work with the XtraGrid control as a black-box application window, that is, you can simulate various mouse actions and keystrokes, record and play back low-level procedures, and so on. For more information, see Simulating User Actions.

In order for TestComplete to have access to internal methods and properties of the XtraGrid control and to extend the XtraGrid control functionality, both the .NET Application Support and Developer Express Control Support plugins must be installed and enabled.

This section describes how to perform the most common operations over the XtraGrid control. It also provides several sample routines you can use in your scripts with minimum changes. These routines work with the sample applications that come with the DevExpress trial package (to learn how to get the sample applications, see the respective topics).

In This Section

Accessing Views in Developer Express XtraGrid

Describes how you can access various grid views.

Searching for Records in Developer Express XtraGrid

Describes how to search for a specific record within the XtraGrid control.

Selecting Cells in Developer Express XtraGrid

Describes approaches used to select individual grid cells.

Getting the Focused Row, Column and Cell in Developer Express XtraGrid

Explains how to determine the row (card), column (card field) and cell that is currently focused.

Activating and Closing In-place Editors in Developer Express XtraGrid

Explains how you can activate the cell’s in-place editor and save the changes made to the cell value.

Obtaining and Setting Cell Values in Developer Express XtraGrid

Describes how you can get and set values in individual grid cells.

Working With Specific In-place Editors in Developer Express XtraGrid

Explains how to work with specific in-place editors in scripts, such as a check box or dropdown editors.

Copying and Pasting Cell Values in Developer Express XtraGrid

Describes how you can copy the cell value to, or paste it from the clipboard.

Selecting Multiple Rows and Cards in Developer Express XtraGrid

Describes how you can select multiple rows (cards) in the XtraGrid.

Obtaining Selected Records in Developer Express XtraGrid

Explains how to obtain the selected records in the XtraGrid control.

Iterating Through Rows and Cards in Developer Express XtraGrid

Explains how to process the XtraGrid rows (cards) in a loop and gives an example of saving the grid contents to an XML file.

Sorting Data in Developer Express XtraGrid

Explains how you can sort the data displayed in the XtraGrid.

Expanding and Collapsing Rows in Developer Express XtraGrid

Describes how you can expand and collapse group and master rows in the XtraGrid control.

Related Topics of Interest

Table Checkpoints

Explains how to create checkpoints that verify data displayed in tabular controls.

Samples

TestComplete includes a sample project that demonstrates how you can work with Developer Express XtraGrid controls from scripts:

<TestComplete Samples>\Desktop\Working With Grids\DevExpress XtraGrid

Note: If you do not have the sample, download the TestComplete Samples installation package from the support.smartbear.com/testcomplete/downloads/samples page of our website and run it.

The script requires a sample application that is part of the DevExpress trial package available at devexpress.com/products/try/.

The script assumes that the application under test has the following path:

<Users>\Public\Public Documents\DevExpress Demos NN.N\Components\WinForms\XtraGrid\Bin\GridMainDemo.exe

Before running the script, make sure that the GridMainDemo item of the Tested Applications project item stores a valid link to the tested application.

See Also

Developer Express XtraGrid Support
Working With Grids
Supported Developer Express Controls
Testing .NET Applications

Highlight search results