Version

Accessing Controls' Properties

`Topic Overview

Purpose

This topic provides reference information about the methods for accessing the properties and sub-properties of Infragistics controls.

Property Access Summary

Property access summary chart

The following table maps the property access tasks with respective the Test Automation methods that implement them.

In order to… Use this method…

Retrieve the value of a (sub-)property of the control

Retrieve the value of a (sub-)property of a sub-item of the control

Retrieve a listing of the visible properties of a control

Retrieve a listing of the visible properties of a sub-item of the control

Set the value of a (sub-)property of the control

Set the value of a (sub-)property of a sub-item of the control

Controls’ Properties Access Methods

Controls’ properties access methods summary chart

The following table briefly explains the methods for accessing the properties and sub-properties of Infragistics controls. The Operation level column of the table indicates whether the method operates on the control as a whole, at the control operational level, for example, on the whole grid, or on some of its parts (sub-item operational level), for example, a cell of the grid. Detailed information about the methods is provided in the text blocks following the table.

The accessibility of each method is specific to the control that is calling the method. For details, please refer to the documentation of the respective control, the Testable User Actions and Elements topic.

Method Operation level Description

control

Returns a list of the visible properties of the specified control or object and their data type.

control

Returns the value of a property or sub-property of the specified control.

control

Sets the value of a property or sub-property of the specified control.

sub-item

Returns a list of the visible properties of a sub-item of the specified control.

sub-item

Returns the value of a property or sub-property sub-item of the specified control.

sub-item

Sets the value of a sub-item property or sub-property of the specified control.

GetNAProperties

Description

A utility method, GetNAProperties returns a list of the visible properties of the specified control or object and their data type.

Details

In the returned list of properties, the custom-defined Test Automation properties are explicitly indicated.

The returned string value uses a carriage return linefeed (/n) to separate each property and a pipe (|) delimiter between the name, data type, and custom property indicator.

Parameters

The following table explains the method’s parameters.

Method Parameter Description

oFullPropertyName

The name of the property whose sub-properties will be returned.

When left BLANK (default), the method returns the control-level properties.

Examples

Example 1

Calling the GetNAProperties method on a UltraGrid and displaying the results in a message box:

props = SwfWindow("MainWindow").SwfTable("grid").GetNAProperties
msgbox props

Example 2

Writing the results of the GetNAProperties method, called on an UltraGrid to a text file, UltraGrid_Props.txt :

fileName = "C:\ultraGrid_Props.txt"
Set grid = SwfWindow("MainWindow").SwfTable("grid")
Set fso = CreateObject("Scripting.FileSystemObject")
Set myFile = fso.CreateTextFile(fileName, true)
strProps = grid.GetNAProperties("")
aryProps = split(strProps, vbCRLF)
for index = 0 to ubound(aryProps)
aryProp = split(aryProps(index), "|")
for index2 = 0 to ubound(aryProp)
myFile.Write(aryProp(index2) & vbTab)
Next
myFile.WriteLine()
Next
myFile.Close()

Example 3

Calling the GetNAProperties method, passing the oFullPropertyName parameter with value ViewSettings and returning a list of the object grid’s ViewSettings properties in a message box:

props = SwfWindow("MainWindow").SwfTable("grid").GetNAProperties("ActiveCell")
msgbox props

GetNAProperty

Description

This method returns the value of a property or sub-property of the specified control.

Supported controls

All Infragistics controls.

Parameters

The following table explains the method’s parameters.

Method Parameter Description

sFullPropertyName

This string represents the fully-qualified name of the property whose value is being retrieved.

Example

Calling the GetNAProperty method on a UltraGrid and displaying the results in a message box:

Set grid = SwfWindow("MainWindow").SwfTable("grid")

props = grid.GetNAProperty("GesturesEnabled")
msgbox props

GetSubItemProperties

Description

A utility method, GetSubItemProperties returns a list of the visible properties of a sub-item of the specified control.

Details

This method returns a list consisting of all the property names of the specified sub-item, their data types, and a flag signaling that the property is a custom-defined Test Automation property. The string returned by this method uses a carriage return linefeed (/n) to separate each property and a pipe (|) delimiter between the name, data type, and custom property indicator.

Supported Controls

  • WinSpreadSheet

Parameters

The following table describes the method’s parameters.

Method Parameter Description

oeSubItemType

Specifies the type of sub-item that the properties belong to (for example, a grid cell).

oSubItem

Uniquely identifies the sub-item whose properties are being retrieved.

oFullPropertyName

The name of the property whose sub-properties will be returned.

When left BLANK (default), the method returns the SUBITEM-level properties.

Examples

Example 1

Getting the properties of a sub-item.

The following code gets the properties of the third grid cell in the Contact Details column and displays the results in a message box:

set book = SwfWindow("MainWindow").SwfObject("ultraSpreadsheet1")
prop = book.GetSubItemProperties("sshtCell", "A3",)
msgbox prop

Example 2

Getting the list of sub-properties of a specific property of a sub-item.

By providing the optional oFullPropertyName parameter, you will get a list of that property’s sub-properties. In the code below, "Text" passed as oFullPropertyName resulting in a list of the sub-properties of the cell’s Text property.set book = SwfWindow("MainWindow").SwfObject("ultraSpreadsheet1")

prop = book.GetSubItemProperties("sshtCell", "A3", "Text")

GetSubItemProperty

Description

This method returns the value of a property or sub-property sub-item of the specified control (for example, the ).

Supported controls

  • WinSpreadsheet

Parameters

The following table explains the method’s parameters.

Method Parameter Description

oeSubItemType

Specifies the type of sub-item that the retrieved property belongs to (for example, a grid cell).

oSubItem

Uniquely identifies the sub-item whose property is being retrieved.

sFullPropertyName

The fully-qualified name of the property whose value is being retrieved.

you with the full property name.

Example

As above, this example gets the SpreadSheetCell’s Text property, but instead returns the property’s value:

Set book = SwfWindow("MainWindow").SwfObject("ultraSpreadsheet1")
prop = book.GetSubItemProperty("sshtCell", "A3", "Text")
msgbox prop

SetNAProperty

Description

This method sets the value of a property or sub-property of the specified control.

Supported controls

All Ultimate UI for Windows Forms controls.

Parameters

The following table explains the method’s parameters.

Method Parameter Description

sFullPropertyName

The fully-qualified name of the property whose value is to be set.

oNewValue

The new value to which the property will be set.

Example

Setting the value of AreHeadersVisible of a WinSpreadsheet called ultraSpreadSheet1 to False:

Set book = SwfWindow("MainWindow").SwfObject("ultraSpreadsheet1")
book.SetNAProperty "AreHeadersVisible", "false"

SetSubItemProperty

Description

This method sets the value of a sub-item property or sub-property of the specified control.

Supported controls

  • WinSpreadsheet

Parameters

The following table explains the method’s parameters.

Method Parameter Description

oeSubItemType

This parameter specifies the type of sub-item to which the property being set belongs (for example, a grid cell).

oSubItem

This parameter uniquely identifies the sub-item whose property is being set.

sFullPropertyName

This parameter is a string, which represents the fully-qualified name of the property whose value is being set.

oNewValue

This parameter is the value to which the property will be set.

Example

Set the value of an USpreadsheetCell:

Set book = SwfWindow("MainWindow").SwfObject("ultraSpreadsheet1")
book.SetSubItemProperty "sshtCell", "A3", "Value", "42"

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides reference information about creating, editing, and running tests.

This topic provides reference information about the Settings and Version utilities.