wColumnCount Property (Grid Controls)

Applies to TestComplete 15.68, last modified on October 01, 2024
This property is not supported in web tests (including cross-platform web tests) that use XPath expressions and CSS selectors to locate web elements. This property can be only used in tests that locate web objects by using internal identification properties provided by TestComplete.

Description

Use the wColumnCount property to get the total number of columns in the given object.

Declaration

TestObj.wColumnCount

Read-Only Property Integer
TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section

Applies To

The property is applied to the following objects:

View Mode

This property is available in the Object Browser panel and in other panels and dialogs in both Basic and Advanced view modes.

Property Value

The total number of columns.

Infragistics WinGridView: If the InfragisticsWinGridView object specifies a grid group, the wColumnCount property returns the number of columns in the parent table of this group.

Remarks

You can use the wColumnCount property along with wRowCount and wValue to iterate through object cells.

Borland StringGrid, Borland TDBGrid

To work with the wColumnCount property, TestComplete must have access to internal methods and properties of the Borland grid control. For this purpose, the VCL Control Support plugin must be installed and enabled, and the tested application must be compiled with debug information (see Implementing Debug Info Agent™ Support in Applications).

Note that TestComplete does not support access to internal properties and methods of VCL controls in 64-bit C++Builder applications. Therefore, the property is inaccessible when testing Borland grid controls in such applications.

The property can also be unavailable to your scripts if it is not used in the application code - Smart Linker just removes it during compilation, since there are no references to it. To solve the problem, make sure the property is used in the application’s source code. For instance, you can add a virtual method to your application that calls the desired property (the compiler does not exclude virtual methods). For detailed information, see Object Properties, Fields and Methods That Are Unavailable to TestComplete.

Borland TDBGrid, Microsoft DataGrid, Microsoft DataGridView, Infragistics WinGridView, DevExpress XtraGridView, Syncfusion EssGridView, WPFToolkit DataGrid, Xceed DotNetGrid, Silverlight DataGrid

The tested control can be configured so that some columns are hidden. So, the value of the wColumnCount property may differ from the number of columns that are actually displayed in the grid.

Example

To view an example that demonstrates how to use the wColumnCount property, see Iterating Through Rows in Infragistics UltraGrid.

See Also

wColumnCount Property (Specific to DevExpressQuantumGrid Controls)
wRowCount Property (Grid Controls)

Highlight search results