SwfTable Object
Description
A grid control based on the .NET Windows Forms library.
IMPORTANT
The following grid controls are supported:
- Microsoft Data Grid
- Infragistics UltraWinGrid
- ComponentOne C1FlexGrid
- ComponentOne C1TrueDBGrid
- DevExpress Data Grid
- DevExpress Pivot Grid
- DevExpress Vertical Grid
For a list of supported grid control versions, see the UFT One Support Matrix.
- UFT One recognizes .NET property grid controls as SwfPropertyGrid test objects (and not SwfTable objects).
- When recording a drop-down window calendar in a ComponentOne C1TrueDBGrid, an additional SetDate step is recorded, and the run session fails. Remove the step before running the action.
Operations
The sections below list the built-in methods and properties that you can use as operations for the SwfTable object.
Note: You can also view a list and descriptions of the SwfTable description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.
Methods
ActivateCell | Double-clicks the specified cell in a grid. |
ActivateCellEditor | Activates the editor of the specified cell in a grid. |
ActivateColumn | Double-clicks the specified column header in a grid. |
ActivateRow | Double-clicks the specified row header in a grid. |
AddCellToSelection | Adds the specified cell to the existing selection. |
AddRow | Adds a new row to the table band using the Add button for the corresponding band. |
AddRowToSelection | Adds the specified row to the existing selection. |
Back | Navigates back to the parent table. |
CaptureBitmap | Saves a screen capture of the object as a .png or .bmp image using the specified file name. |
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
ClearGrouping | Clears the existing column grouping. |
ClearSelection | Clears the existing selection in the grid. |
Click | Clicks an object. |
CollapseRow | Collapses the specified row. |
CollapseAllGroups | Collapses all group rows. |
CollapseAllRows | Collapses all rows. |
DblClick | Double-clicks an object |
DeselectCell | Deselects the specified cell. |
DeselectRow | Deselects the specified row. |
Drag | Performs the 'drag' part of a drag-and-drop operation. |
Drop | Performs the 'drop' part of a drag-and-drop operation. |
ExpandAllGroups | Expands all group rows. |
ExpandAllRows | Expands all rows. |
ExpandRow | Expands the specified row. |
FireEvent | Simulates an event on a .NET object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetCellData | Retrieves the contents of the specified cell in a grid. |
GetCellProperty | Returns the value of a grid cell property. |
GetChildRowsCount | Returns the number of child rows of the specified row in the grid. |
GetChildRowsPaths | Returns the paths of the child rows of the specified row in the grid. |
GetColumnsCount | Returns the number of columns in the grid. |
GetColumnsNames | Returns the headers of the columns in the grid. |
GetErrorProviderText | Returns the tooltip text of the error icon associated with the object. |
GetRecordsCount | Returns the number of records in the grid. |
GetROProperty | Returns the current value of the description property from the object in the application. |
GetRowsCount | Returns the number of rows in the grid. |
GetRowsPaths | Returns the paths of the rows in the grid. |
GetTextLocation | Checks whether the specified text string is contained in the specified window area. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
GetVisibleText | Returns the text from the specified area. |
GroupByColumn | Groups table rows according to the specified column. |
Highlight | Highlights the object in the application. |
HideColumn | Hides the specified column. |
HideParentRow | Hides the parent row, when the child grid is displayed. |
HideRow | Hides the specified row. |
IsRowSelected | Indicates whether the specified row is selected. |
MakeCellVisible | Scrolls the specified cell into view if it is not visible in the grid. |
MouseMove | Moves the mouse pointer to the designated position over the object. |
MoveCoulmn | Moves the specified column to the specified destination column's position. |
MoveRow | Moves the specified row to the specified destination row's position. |
OpenCellElement | Selects the specified cell and opens a cell's pop-up cell element. |
OpenCellRelation | Opens the child table referenced by the link in the specified cell. |
OpenSummaryDlg | Opens the summary dialog box for the specified column. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs UFT One to re-identify the object in the application the next time a step refers to this object. |
SelectCell | Selects (clicks) the specified cell in a grid. |
SelectColumn | Selects (clicks) the specified column header in a grid. |
SelectRow | Selects the specified row. |
SetCellData | Sets the contents of a cell with the specified string. |
SetMultiCellData | Sets the contents of a cell in a multi-editor row with the specified string. |
SetFilter | Applies the specified filter string to the specified column. |
SetSelection | Sets a rectangle shaped selection. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
SetView | Expands the parent rows of the specified view and makes it the current view. |
ShowColumn | Makes the specified column visible in the grid. |
ShowParentRow | Displays the parent row, when the child grid is displayed. |
ShowRow | Makes the specified row visible in the grid. |
Sort | Sorts the table contents according to the specified column. |
ToString | Returns a string that represents the test object. |
Type | Types the specified string in the object. |
UnGroupByColumn | Ungroups table rows according to the specified column. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
ColumnCount | Returns the number of columns in the grid. |
Exist | Checks whether the object currently exists in the open application. |
Object | Accesses the native methods and properties of the object. |
RowCount | Returns the number of rows in the grid. |
ActivateCell Method
Description
Double-clicks the specified cell in a grid.
Syntax
object.ActivateCell Row, Column
For DevExpress Vertical Grids: object.ActivateCell rowPath, recordIndex, [cellCaption]
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
Column/recordIndex | Required. A Variant. The location of the column within the grid. In most cases, the column header name (string) or the column index (0-based number).
|
cellCaption | Optional. A String. The caption of the cell within a multi-editor row in the grid. Relevant for multi-editor rows in DevExpress Vertical Grids. If not specified, the first cell in the record is used. |
Return Type
None
Example
'This example uses the ActivateCell method with Microsoft DataGrid control to activate the cell in 'the fifth row and second column. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ActivateCell 4, 1
'This example uses the ActivateCell method with ComponentOne C1FlexGrid control to activate the 'fourth row of the "Name" column. SwfWindow("C1FlexGrid:").SwfTable("flex1").ActivateCell 3, "Name"
'This example uses the ActivateCell method with Infragistics UltraWinGrid control to activate the 'first row of the "Total" column in the second-level band. SwfWindow("SamplesExplorer").SwfWindow("Row Filtering").SwfTable("UltraGrid1").ExpandRow 1 SwfWindow("SamplesExplorer").SwfWindow("Row Filtering").SwfTable("UltraGrid1").ActivateCell "1;0", "Total"
'This example uses the ActivateCell method to activate the cell in the first row and first column
'of a DevExpress Pivot Grid.
SwfWindow("DevExpress Controls").SwfTable("pGridControl").ActivateCell 0, 0
'This example uses the ActivateCell method to activate the cell in the first row and first column
'of a DevExpress Data Grid, and then to activate the cell in the first row and the column named ID.
SwfWindow("DevExpress Controls").SwfTable("gridControl").ActivateCell 0, 0
SwfWindow("DevExpress Controls").SwfTable("gridControl").ActivateCell 0, "ID"
'This example uses the ActivateCell method to activate the first cell in the Path row
'in a DevExpress Vertical Grid and then to activate the Size part of the first cell in the
'House multi-editor row.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").ActivateCell "Path", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").ActivateCell "House;(Color;Size)", 0, "Size"
ActivateCellEditor Method
Description
Activates the editor of the specified cell in a grid.
Syntax
object.ActivateCellEditor rowIndex, columnIndex
Arguments
Parameter | Description |
---|---|
rowIndex | Required. A Variant. The location of the row within the grid. For DevExpress Pivot Grids: The 0-based number of the row in the current view. |
columnIndex | Required. A Variant. The location of the column within the grid. In most cases, the column header name (string) or the column index (0-based number). For DevExpress Pivot Grids: The 0-based column index (number). |
Return Type
None
Example
'This example uses the ActivateCellEditor method to activate the editor of the cell in the first row and first column
'of a DevExpress Pivot Grid.
SwfWindow("DevExpress Controls").SwfTable("pivotGridControl").ActivateCellEditor 0, 0
ActivateColumn Method
Description
Double-clicks the specified column header in a grid.
Syntax
object.ActivateColumn Column
Arguments
Parameter | Description |
---|---|
Column | Required. A Variant. The location of the column within the grid.
|
Return Type
None
IMPORTANT
This method is not supported for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Example
'This example uses the ActivateColumn method with Infragistics UltraWinGrid control to activate the '"Total" column in the second-level band. SwfWindow("SamplesExplorer").SwfWindow("Row Filtering").SwfTable("UltraGrid1").ActivateColumn "1;Total"
'This example uses the ActivateColumn method with ComponentOne C1TrueDBGrid control to activate 'the "Freight" column. SwfWindow("Form1").SwfTable("c1TrueDBGrid1").ActivateColumn "Freight"
ActivateRow Method
Description
Double-clicks the specified row header in a grid.
Syntax
object.ActivateRow Row
Arguments
Parameter | Description |
---|---|
Row | Required. A Variant. The location of the row within the grid. The 0-based number of the row. For Infragistics UltraWinGrid: The 0-based row number for top level bands. For child bands, specify the row with a string in the format: "n1;n2;...nX" where n is the row number in each band level. |
Return Type
None
IMPORTANT
This method is not supported for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Example
'This example uses the ActivateRow method with Infragistics UltraWinGrid control to activate the 'third row in the third-level band. SwfWindow("Row Filtering").SwfTable("UltraGrid1").ActivateRow "1;0;2"
'This example uses the ActivateRow method with ComponentOne C1TrueDBGrid control to activate the 'fourth row in the grid. SwfWindow("Form1").SwfTable("c1TrueDBGrid1").ActivateRow 3
AddCellToSelection Method
Description
Adds the specified cell to the existing selection.
Syntax
objectAddCellToSelection row, column
For DevExpress Vertical Grid: object.AddCellToSelection rowPath, recordIndex, [cellCaption]
Arguments
Parameter | Description |
---|---|
row/rowPath | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. For DevExpress Vertical Grids: The row's path (string). Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
column/recordIndex | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the column index (0-based number). For DevExpress Pivot Grids: The 0-based column index (number). For DevExpress Vertical Grids: The 0-based record index (number). |
cellCaption | Optional. A String. The caption of the cell within a multi-editor row in the grid. Relevant for multi-editor rows in DevExpress Vertical Grids. If not specified, the first cell in the record is used. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Before running this method, one or more cells must already be selected in the grid.
Example
'This example uses the SelectCell method to select the first cell in a DevExpress 'Pivot Grid and then the AddCellToSelection method to add the 3rd cell in the 6th row to the selection. SwfWindow("DevExpress Controls").SwfTable("pGridControl").SelectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("pGridControl").AddCellToSelection 5, 2
'This example uses the SelectCell method to select the first cell in a DevExpress 'Data Grid and then the AddCellToSelection method to add the Invoice Details cell in the 6th row to the selection. SwfWindow("DevExpress Controls").SwfTable("gridControl").SelectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("gridControl").AddCellToSelection 5, "Invoice Details"
'This example uses the SelectCell method to select the first record in the Path row
'and then the AddCellToSelection method to add the Size part of the first cell in the multi-editor row, House,
' to the set of selected cells in a DevExpress Vertical Grid.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectCell "Path", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").AddCellToSelection "House;(Color;Size)", 0, "Size)"
AddRow Method
Description
Adds a new row to the table band using the Add button for the corresponding band.
Syntax
object.AddRow AddButtonName, [Row]
Arguments
Parameter | Description |
---|---|
AddButtonName |
Required. A Variant. The name of the Add button corresponding to the band to which you want to add a row. |
Row |
Optional. A Variant. The band path that shows where the row is added. Separate band levels with semicolons(;). Row numbers in each band are 0-based.
For example: "4;0;2" |
Return Type
None.
IMPORTANT
This method is supported only for Infragistics UltraWinGrid controls.
Example
'This example uses the AddRow method to expand the table to display the sixth row in the second-level 'band, and then clicks the "Invoice Details" button to add a row to that band. SwfWindow("Layouts").SwfTable("gridOne").ExpandRow "0;5" SwfWindow("Layouts").SwfTable("gridOne").AddRow " Invoice Details", "0;5"
AddRowToSelection Method
Description
Adds the specified row to the existing selection.
Syntax
object.AddRowToSelection row
For DevExpress Vertical Grids: object.AddRowToSelection rowPath
Arguments
Parameter | Description |
---|---|
row/rowPath | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. For DevExpress Vertical Grids: The row's path (string). Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Before running this method, one or more rows must already be selected in the grid.
Example
'This example uses the AddRowToSelection method to add the first row
' to the set of selected rows in a DevExpress Data Grid.
SwfWindow("DevExpress Controls").SwfTable("gridControl").SelectRow 1
SwfWindow("DevExpress Controls").SwfTable("gridControl").AddRowToSelection 0
'This example uses the AddRowToSelection method to add the Color row ' to the set of selected rows in a DevExpress Vertical Grid. SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectRow "Price;Full Name;Category;Color" SwfWindow("DevExpress Controls").SwfTable("vGridControl").AddRowToSelection "Price;Last Name;Category;Color"
Back Method
Description
Navigates back to the parent table.
Syntax
object.Back
Return Type
None.
IMPORTANT
This method is supported only for Microsoft Data Grid controls.
Example
'This example uses the Back method to return to the parent table after opening a child table in 'the third row and first column of the "myDataGrid" control. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 2 SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 2, 0 SwfWindow("DataGrid Control").SwfTable("myDataGrid").Back
ClearGrouping Method
Description
Clears the existing column grouping.
Syntax
object.ClearGrouping
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Before this method can run, some rows in the grid must be grouped.
Example
'This example uses the ClearGrouping method to clear the grouping in the grid. SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn 0 SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn "Discount" SwfWindow("DevExpress Controls").SwfTable("gridControl").ClearGrouping()
ClearSelection Method
Description
Clears the existing selection in the grid.
Syntax
object.ClearSelection
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid, Vertical Grid, and Pivot Grid controls.
Before running this method, some cells or rows must already be selected in the grid.
Example
'This example uses the ClearSelection method to clear any selections previously made in the grid. SwfWindow("DevExpress Controls").SwfTable("gridControl").SelectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("gridControl").AddCellToSelection 0, 1 SwfWindow("DevExpress Controls").SwfTable("gridControl").SelectRow 6 SwfWindow("DevExpress Controls").SwfTable("gridControl").ClearSelection()
Click Method
Description
Clicks an object.
Syntax
object.Click [X], [Y], [BUTTON]
Arguments
Parameter | Description |
---|---|
X |
Optional. An integer value. The x-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Default value = -9999 |
Y |
Optional. An integer value. The y-coordinate of the click. Note that the specified coordinates are relative to the upper left corner of the object. The default value is the center of the object. Tip: You can enter micNoCoordinate for the x and y argument values if you want to enter a value for the button argument without specifying x- and y- coordinates for the click. Default value = -9999 |
BUTTON |
Optional. A predefined constant or number. The mouse button used to click the object. Default value = micLeftBtn |
Return Type
None
Example
'This example uses the Click method to click a right mouse button at coordinates 47, 131 on the "button4" 'button. SwfWindow("Form1").SwfButton("button4").Click 47, 131, 1
CollapseAllGroups Method
Description
Collapses all group rows.
Syntax
object.CollapseAllGroups
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Before this method can run, some rows in the grid must be grouped.
Example
'This example uses the CollapseAllGroups method to collapse all expanded groups in the data grid. SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn 0 SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn "Discount" SwfWindow("DevExpress Controls").SwfTable("gridControl").ExpandAllGroups() SwfWindow("DevExpress Controls").SwfTable("gridControl").CollapseAllGroups()
CollapseAllRows Method
Description
Collapses all rows.
Syntax
object.CollapseAllRows
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Before this method can run, some rows in the grid must be grouped.
Example
'This example uses the CollapseAllRows method to collapse all grouped rows in the Vertical Grid. SwfWindow("DevExpress Controls").SwfTable("vGridControl").CollapseAllRows()
CollapseRow Method
Description
Collapses the specified row.
Syntax
object.CollapseRow Row, [recursive]
For DevExpress Vertical Grids: object.CollapseRow rowPath
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
recursive | Optional. A Boolean value. Indicates whether to recursively collapse all of the rows nested in the specified row. Default = False This parameter is only relevant for DevExpress Data Grids. |
Return Type
None.
IMPORTANT
This method is supported only for the following controls:
- Microsoft Data Grid
- Infragistics UltraWinGrid
- ComponentOne: C1FlexGrid, C1TrueDBGrid.
- DevExpress Data Grid, Vertical Grid
Example
'This example uses the CollapseRow method with Microsoft Data Grid control to collapse the third 'row in the grid. SwfWindow("DataGrid Control").SwfTable("myDataGrid").CollapseRow 2
'This example uses the CollapseRow method with Infragistics UltraWinGrid control to collapse the 'sixth row in the second-level band. SwfWindow("Layouts").SwfTable("gridOne").CollapseRow "0;5"
'This example uses the CollapseRow method with DevExpress Data Grid control to collapse the third 'row in the "Master" view, and then collapse the first row and all rows nested in it. SwfWindow("MasterView").SwfTable("gridControl1").CollapseRow 2 SwfWindow("MasterView").SwfTable("gridControl1").CollapseRow 0, "True"
'This example uses the CollapseRow method to collapse the Full Name row in a DevExpress Vertical Grid.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").CollapseRow "Path;Full Name"
DblClick Method
Description
Double-clicks an object
Syntax
object.DblClick X, Y, [BUTTON]
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The x-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. |
Y |
Required. An integer value. The y-coordinate of the double-click. Note that the specified coordinates are relative to the upper left corner of the object. |
BUTTON |
Optional. A predefined constant or number. The mouse button used to double-click the object. Default value = micLeftBtn |
Return Type
None
Example
'This example uses the DblClick method to double-click a right mouse button at coordinates 73, 120 on 'the "Test" window. SwfWindow("Test").DblClick 73, 120, 1
DeselectCell Method
Description
Deselects the specified cell.
Syntax
objectDeselectCell row, column
For DevExpress Vertical Grid: object.DeselectCell rowPath, recordIndex, [cellCaption]
Arguments
Parameter | Description |
---|---|
row/rowPath | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. For DevExpress Vertical Grids: The row's path (string). Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
column/recordIndex | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the column index (0-based number). For DevExpress Pivot Grids: The 0-based column index (number). For DevExpress Vertical Grids: The 0-based record index (number). |
cellCaption | Optional. A String. The caption of the cell within a multi-editor row in the grid. Relevant for multi-editor rows in DevExpress Vertical Grids. If not specified, the first cell in the record is used. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Example
'This example uses the DeselectCell method to deselect the first cell in a DevExpress 'Pivot Grid and then deselect the 3rd cell in the 6th row. SwfWindow("DevExpress Controls").SwfTable("pGridControl").SelectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("pGridControl").AddCellToSelection 5, 2 SwfWindow("DevExpress Controls").SwfTable("pGridControl").DeselectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("pGridControl").DeselectCell 5, 2
'This example uses the DeselectCell method to deselect the first cell in a DevExpress 'Data Grid and then deselect the Invoice Details cell in the 6th row. SwfWindow("DevExpress Controls").SwfTable("gridOne").SelectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("gridOne").AddCellToSelection 5, "Invoice Details" SwfWindow("DevExpress Controls").SwfTable("gridOne").DeselectCell 0, 0 SwfWindow("DevExpress Controls").SwfTable("gridOne").DeselectCell 5, "Invoice Details"
'This example uses the DeselectCell method to deselect cells in a DevExpress Vertical Grid.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectCell "Path", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").AddCellToSelection "Path;(Color;Size)", 0, "Size"
SwfWindow("DevExpress Controls").SwfTable("vGridControl").DeselectCell "Path", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").DeselectCell "Path;(Color;Size)", 0, "Size"
DeselectRow Method
Description
Deselects the specified row.
Syntax
object.DeselectRow row
For DevExpress Vertical Grids: object.DeselectRow rowPath
Arguments
Parameter | Description |
---|---|
row/rowPath | Required. A Variant. The location of the row within the grid. Specify the 0-based number of the row in the current view. For DevExpress Vertical Grids: The row's path (string). Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Example
'This example uses the DeselectRow method to deselect the first row
' in a DevExpress Data Grid.
SwfWindow("DevExpress Controls").SwfTable("gridControl").SelectRow 0
SwfWindow("DevExpress Controls").SwfTable("gridControl").DeselectRow 0
'This example uses the DeselectRow method to deselect the Color row ' in a DevExpress Vertical Grid. SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectRow "Price;Full Name;Category;Color" SwfWindow("DevExpress Controls").SwfTable("vGridControl").DeselectRow "Price;Full Name;Category;Color"
Drag Method
Description
Performs the 'drag' part of a drag-and-drop operation.
Syntax
object.Drag X, Y, [BUTTON]
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The coordinates within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. |
Y |
Required. An integer value. The coordinates within the window from which the object is dragged. Note that the specified coordinates are relative to the upper left corner of the object. |
BUTTON |
Optional. A predefined constant or number. The mouse button used to drag the object. Default value = micLeftBtn |
Return Type
None
Example
'This example uses the Drag method to drag the object from coordinates 10, 20 within the "Test" window, 'to coordinates 30, 40 within the "OtherWindow". SwfWindow("Test").Drag 10, 20 SwfWindow("OtherWindow").Drop 30, 40 'or, within the same window: SwfWindow("Test").Drag 10, 20 SwfWindow("Test").Drop 30, 40
Drop Method
Description
Performs the 'drop' part of a drag-and-drop operation.
Syntax
object.Drop X, Y, [BUTTON]
Arguments
Parameter | Description |
---|---|
X |
Required. An integer value. The coordinates of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. |
Y |
Required. An integer value. The coordinates of the object onto which the object is dropped. Note that the specified coordinates are relative to the upper left corner of the object. |
BUTTON |
Optional. A predefined constant or number. The button that is released to drop the object. Default value = micLeftBtn |
Return Type
None
Example
'This example uses the Drop method to drop the object at coordinates 30, 40 within the "OtherWindow" after 'dragging from coordinates 10, 20 within the "Test" window. SwfWindow("Test").Drag 10, 20 SwfWindow("OtherWindow").Drop 30, 40 'or, within the same window: SwfWindow("Test").Drag 10, 20 SwfWindow("Test").Drop 30, 40
ExpandAllGroups Method
Description
Expands all group rows.
Syntax
object.ExpandAllGroups
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Before this method can run, some rows in the grid must be grouped.
Example
'This example uses the GroupByColumn method to group some rows in the data grid, 'and then uses the ExpandAllGroups method to expand all groups. SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn 0 SwfWindow("DevExpress Controls").SwfTable("gridControl").GroupByColumn "Price" SwfWindow("DevExpress Controls").SwfTable("gridControl").ExpandAllGroups
ExpandAllRows Method
Description
Expands all rows.
Syntax
object.ExpandAllRows
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Before this method can run, some rows in the grid must be grouped.
Example
'This example uses the ExpandAllRows method to expand all groups in the Vertical Grid. SwfWindow("DevExpress Controls").SwfTable("vGridControl").ExpandAllRows
ExpandRow Method
Description
Expands the specified row.
Syntax
object.ExpandRow Row, [recursive]
For DevExpress Vertical Grids: object.ExpandRow rowPath
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
recursive | Optional. A Boolean value. Indicates whether to recursively expand all of the rows nested in the specified row. Default = False This parameter is only relevant for DevExpress Data Grids. |
Return Type
None.
IMPORTANT
This method is supported only for the following controls:
- Microsoft Data Grid
- Infragistics UltraWinGrid
- ComponentOne: C1FlexGrid, C1TrueDBGrid.
- DevExpress Data Grid, Vertical Grid
Example
'This example uses the ExpandRow method with Microsoft Data Grid control to expand the third row 'in the grid to open a cell relation in that row. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 2 SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 2, 0
'This example uses the ExpandRow method with Infragistics UltraWinGrid control to expand the second 'row in the top-level band to activate a cell in that band's child table. SwfWindow("SamplesExplorer").SwfWindow("Row Filtering").SwfTable("UltraGrid1").ExpandRow 1 SwfWindow("SamplesExplorer").SwfWindow("Row Filtering").SwfTable("UltraGrid1").ActivateCell "1;0", "Total"
'This example uses the ExpandRow method with DevExpress Data Grid control to expand the third 'row in the "Master" view, and then expand the first row and all rows nested in it. SwfWindow("MasterView").SwfTable("gridControl1").GroupByColumn 0 SwfWindow("MasterView").SwfTable("gridControl1").GroupByColumn "Discount" SwfWindow("MasterView").SwfTable("gridControl1").ExpandRow 2 SwfWindow("MasterView").SwfTable("gridControl1").ExpandRow 0, "True"
'This example uses the ExpandRow method to expand a row in a DevExpress Vertical Grid.
SwfWindow("MasterView").SwfTable("vGridControl1").GroupByColumn 0
SwfWindow("MasterView").SwfTable("vGridControl1").GroupByColumn "Discount"
SwfWindow("DevExpress Controls").SwfTable("vGridControl").ExpandRow "Path;Full Name"
FireEvent Method
Description
Simulates an event on a .NET object.
Syntax
object.FireEvent EventName
Arguments
Parameter | Description |
---|---|
EventName |
Required. A Variant. The name of the event to simulate. The list of possible events depends on the object. |
Required. None The Args argument is passed to the constructor of the event's EventArgs object or the implementing class. Enter the values in a comma separated list. If no event arguments are required, you do not need to supply a value for the argument. |
Return Type
None.
IMPORTANT
The event is sent to all listeners of the .NET object and does not affect the .NET object itself. For example, simulating a click event does not actually perform the click.
Example
'This example uses the FireEvent method to simulate a Click event on the "Save" button. SwfWindow("Welcome").SwfButton("Save").FireEvent "Click"
GetCellData Method
Description
Retrieves the contents of the specified cell in a grid.
Syntax
object.GetCellData Row, Column
For DevExpress Vertical Grid: object.GetCellData rowPath, recordIndex, [cellCaption]
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
column/recordIndex | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the column index (0-based number). For Microsoft DataGrids and DevExpress Pivot Grids: The 0-based column index (number). For DevExpress Vertical Grids: The 0-based record index (number). |
cellCaption | Optional. A String. The caption of the cell within a multi-editor row in the grid. Relevant for multi-editor rows in DevExpress Vertical Grids. If not specified, the first cell in the record is used. |
Return Type
A String value.
Example
'This example uses the GetCellData method with Infragistics UltraWinGrid control to return the data 'contained in the second row of the "Description" column within the second band level. MyData = SwfWindow("Layouts").SwfTable("gridOne").GetCellData("0;1", "Description") MsgBox MyData
'This example uses the GetCellData method to return the data contained in the third row 'of the 2nd column in DevExpress Pivot Grid control. MyData = SwfWindow("DevExpress Controls").SwfTable("pGridControl1").GetCellData(2, 1) MsgBox MyData
'This example uses the GetCellData method to return the data contained in the third row 'of the "CustomerID" column in DevExpress Data Grid control. MyData = SwfWindow("DevExpress Controls").SwfTable("gridControl1").GetCellData(2, "CustomerID") MsgBox MyData
'This example uses the GetCellData method to retrieve the Size value from a cell in a multi-editor
'row in a DevExpress Vertical Grid.
MyData = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetCellData "Path;(Color;Size)", 0, "Size"
MsgBox MyData
GetCellProperty Method
Description
Returns the value of a grid cell property.
Syntax
object.GetCellProperty Row, Column, PropertyName
Arguments
Parameter | Description |
---|---|
Row | Required. A Variant. The location of the row within the grid.
|
Column | Required. A Variant. The location of the column within the grid.
|
PropertyName |
Required. A String value. The name of the property, specified as a string. Possible values:
|
Return Type
A Variant.
Returns the value of the specified property.
If the specified PropertyName is not one of the supported properties, a NOT_IMPLEMENTED error occurs.
Example
'Get the salary of the specified employee Dim cnt, curRow, colWorkName, colSalary colWorkName = 1 colSalary = 7 ' Sorting by the searched value may help find the Employee Name faster ' if you use a more efficient search algorithm than This example ' SwfWindow("GridStyles (VB Demo)").SwfTable("GridControl1").Sort _ ' colWorkName, "Descending" ' ' Get the number of rows cnt = SwfWindow("GridStyles (VB Demo)").SwfTable("GridControl1").RowCount 'Check the name column in each row For curRow = 0 To cnt - 1 workerName = _ SwfWindow("GridStyles (VB Demo)").SwfTable("GridControl1").GetCellProperty(curRow, colWorkName, "value") 'If the employee is found on this row, return the salary from the salary column If workerName = employeeName Then findSalary = _ SwfWindow("GridStyles (VB Demo)").SwfTable("GridControl1").GetCellProperty(curRow, colSalary, "value") ExitFunctionEndIfNext' Not found findSalary = -1 'Use example: 'MsgBox findSalary("John Smith")
'This example uses the GetCellProperty method to get the value of the "x" property for the cell 'located in the ninth row, third column of the "myDataGrid" table. Dim strCellProp strCellProp = SwfWindow("DataGrid Control Sample").SwfTable("myDataGrid").GetCellProperty(8, 2, "x")
GetChildRowsCount Method
Description
Returns the number of child rows of the specified row in the grid.
Syntax
object.GetChildRowsCount rowPath, [includeHiddenRows]
Arguments
Parameter | Description |
---|---|
rowPath | Required. A String. The path to the row's location in the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
includeHiddenRows | Optional. A Boolean value. Indicates whether to include hidden rows in the child row count. (Default = false) |
Return Type
An Integer.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the GetChildRowsCount method to return the number of visible child rows in
'in a DevExpress Vertical Grid row. Then, it uses GetChildRowsCount again, this time to include hidden rows in the count.
GetChildRowsCount = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetChildRowsCount("Path;Full Name")
MsgBox GetChildRowsCount
GetChildRowsCount = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetChildRowsCount("Path;Full Name", True)
MsgBox GetChildRowsCount
GetChildRowsPaths Method
Description
Returns the paths of the child rows of the specified row in the grid.
Syntax
object.GetChildRowsPaths rowPath, [includeHiddenRows]
Arguments
Parameter | Description |
---|---|
rowPath | Required. A String. The path to the row's location in the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
includeHiddenRows | Optional. A Boolean value. Indicates whether to include the paths of hidden rows. (Default = false) |
Return Type
A list of strings.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the GetChildRowsPaths method to return the paths of the visible child rows in
'in the 'Product' row. Then, it uses GetChildRowsCount again, this time to return also the hidden rows child rows.
Dim ChildRowsPaths
Set ChildRowsPaths = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetChildRowsPaths ("Product;Version")
ChildRowsPathsCount = ChildRowsPaths.Count
For i = 0 To ChildRowsPathsCount - 1
Print ChildRowsPaths(i)
Next
Set ChildRowsPaths = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetChildRowsPaths ("Product;Version", True)
ChildRowsPathsCount = ChildRowsPaths.Count
For i = 0 To ChildRowsPathsCount - 1
Print ChildRowsPaths(i)
Next
GetColumnsCount Method
Description
Returns the number of columns in the grid.
Syntax
object.GetColumnsCount [includeHiddenColumns]
Arguments
Parameter | Description |
---|---|
includeHiddenColumns | Optional. A Boolean value. Relevant only for DevExpress Data Grid controls. Indicates whether to include the grid's hidden columns in the count. (Default = false) |
Return Type
An Integer.
IMPORTANT
This method is supported only for DevExpress Data Grid and DevExpress Pivot Grid controls.
Example
'This example uses the GetColumnsCount method to return the number of visible columns in the grid
'and the number of all columns, including the hidden ones.
ColumnsCount = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetColumnsCount
MsgBox ColumnsCount
ColumnsCount = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetColumnsCount True
MsgBox ColumnsCount
GetColumnsNames Method
Description
Returns the headers of the columns in the grid.
Syntax
object.GetColumnsNames [includeHiddenColumns]
Arguments
Parameter | Description |
---|---|
includeHiddenColumns | Optional. A Boolean value. Indicates whether to include the names of the grid's hidden columns. (Default = false) |
Return Type
A list of strings.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the GetColumnsNames method to return the names of all visible columns in the
'grid, and then the names of all columns, including the hidden ones.
Dim ColumnsNames
Set ColumnsNames = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetColumnsNames
ColumnsNamesCount = ColumnsNames.Count
For i = 0 To ColumnsNamesCount - 1
Print ColumnsNames(i).Name & ": " & ColumnsNames(i).Value
Next
Set ColumnsNames = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetColumnsNames True
ColumnsNamesCount = ColumnsNames.Count
For i = 0 To ColumnsNamesCount - 1
Print ColumnsNames(i).Name & ": " & ColumnsNames(i).Value
Next
GetErrorProviderText Method
Description
Returns the tooltip text of the error icon associated with the object.
Syntax
object.GetErrorProviderText
Return Type
A String value.
If no error provider control currently exists for the object, the method returns an empty string.
Example
'This example enters some text into an edit box and then uses the 'GetErrorProviderText method to check whether the edit box has an error icon. 'If the method returns a value other than an empty string, then there is an 'error, so the Cancel button is clicked in the dialog box. If the string is empty, ' then there is no error and the Apply button is clicked. SwfWindow("Form1").SwfEdit("Ex_textBox").Set Text Dim ErrorMessage ErrorMessage = SwfWindow("Form1").SwfEdit("Ex_textBox").GetErrorProviderText IfLen(ErrorMessage) <> 0 Then SwfWindow("Form1").SwfButton("Cancel").Click Else SwfWindow("Form1").SwfButton("Apply").Click EndIf
GetRecordsCount Method
Description
Returns the number of records in the grid.
Syntax
object.GetRecordsCount
Return Type
An Integer.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the GetRecordsCount method to return the number of records in the grid.
RecordsCount = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetRecordsCount
MsgBox RecordsCount
GetRowsCount Method
Description
Returns the number of rows in the grid.
Syntax
object.GetRowsCount [includeHiddenRows]
Arguments
Parameter | Description |
---|---|
includeHiddenRows | Optional. A Boolean value. Indicates whether to include the grid's hidden rows in the count. (Default = false) This parameter is not relevant for DevExpress Pivot Grid controls. Note: When data grouping is applied, group rows are not included in the count if you set the parameter to true. |
Return Type
An Integer.
IMPORTANT
This method is supported only for DevExpress Data Grid, DevExpress Vertical Grid, DevExpress Pivot Grid controls.
Example
'This example uses the GetRowsCount method to return the number of visible rows in the grid
'and the number of all rows, including the hidden ones.
RowsCount = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetRowsCount
MsgBox RowsCount
RowsCount = SwfWindow("DevExpress Controls").SwfTable("gridControl").GetRowsCount True
MsgBox RowsCount
GetRowsPaths Method
Description
Returns the paths of the rows in the grid.
Syntax
object.GetRowsPaths [includeHiddenRows]
Arguments
Parameter | Description |
---|---|
includeHiddenRows | Optional. A Boolean value. Indicates whether to include the paths of the grid's hidden rows. (Default = false) |
Return Type
A list of strings.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the GetRowPaths method to return the paths of all visible rows in the
'grid, and then the paths of all rows, including the hidden ones.
Dim RowsPaths
Set RowsPaths = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetRowsPaths
RowsPathsCount = RowsPaths.Count
For i = 0 To RowsPathsCount - 1
Print RowsPaths(i).Name & ": " & RowsPaths(i).Value
Next
Set RowsPaths = SwfWindow("DevExpress Controls").SwfTable("vGridControl").GetRowsPaths True
RowsPathsCount = RowsPaths.Count
For i = 0 To RowsPathsCount - 1
Print RowsPaths(i).Name & ": " & RowsPaths(i).Value
Next
GetTextLocation Method
Description
Checks whether the specified text string is contained in the specified window area.
Syntax
object.GetTextLocation TextToFind, Left, Top, Right, Bottom, [MatchWholeWordOnly]
Arguments
Parameter | Description |
---|---|
TextToFind |
Required. A String value. The text string you want to locate. |
Left |
Required. A Variant. The left coordinate of the search area within the window or screen, as a long integer. |
Top |
Required. A Variant. The top coordinate of the search area within the window or screen, as a long integer. |
Right |
Required. A Variant. The right coordinate of the search area within the window or screen, as a long integer. |
Bottom |
Required. A Variant. Note: Set the Left, Top, Right, and Bottom coordinates to -1 to search for the text string within the object's entire window. |
MatchWholeWordOnly |
Optional. A Boolean value. If True, the method searches for occurrences that are whole words only and not part of a larger word. If False, the method does not restrict the results to occurrences that are whole words only. Default value = True |
Return Type
A Boolean value.
Indicates whether the text was found in the specified coordinates. Additionally, if the text is found, this method returns the coordinates of the rectangle containing the first instance of the text into the Left, Top, Right, and Bottom arguments.
IMPORTANT
- The text to capture must be visible in the application window when the step runs.
- This method returns True only if the TextToFind argument value is found within a single line in the specified area. The text search restarts on each line of text.
- If the TextToFind argument value includes a space, then this method searches for that text as whole words, regardless of the value set in the MatchWholeWords argument. For example, if you search for "a b" and the text "bla bla" exists, the method will still return False. However, if the MatchWholeWords argument is set to False, then a search for "la" in an area where "bla bla" exists, would return True.
- If the text is found (return value = True) and if the Left, Top, Right, and Bottom arguments are supplied as variables, then the method also returns the exact coordinates of the specified text to the supplied arguments (the returned coordinates overwrite the supplied ones).
- The results of this method may be different depending on the settings selected in the Text Recognition pane of the Options dialog box (Tools menu > Options item > GUI Testing node > Text Recognition node).
- The results of this method may be different in different run sessions depending on the operating system version you are using, service packs you have installed, other installed toolkits, or the APIs used in your application. Therefore, when possible, it is highly recommended to use the GetROProperty Method to retrieve the value of the text (or equivalent) property from an object in your application instead of using the GetTextLocation method.
- By default, when UFT One captures text for a text/text area checkpoint or output value step using the GetText, GetTextLocation, or GetVisibleText methods, it tries to retrieve the text directly from the object using a Windows API-based mechanism. If UFT One cannot capture the text this way (for example, because the text is part of a picture), it tries to capture the text using an OCR (optical character recognition) mechanism. For details about changing this behavior, see the Can QuickTest Professional Text Recognition behavior be modified Knowledgebase article (number KM202721).
Example
'This example uses the GetTextLocation method to retrieve all of the text within the object. l = -1 t = -1 r = -1 b = -1 result = SwfWindow("Open").SwfEdit("File &name:").GetTextLocation("2002", l, t, r, b) If result ThenMsgBox"Text found. Coordinates:" & l & "," & t & "," & r & "," & b EndIf
GetVisibleText Method
Description
Returns the text from the specified area.
Syntax
object.GetVisibleText [Left], [Top], [Right], [Bottom]
Arguments
Parameter | Description |
---|---|
Left |
Optional. A long integer value. The left coordinate of the search area within the object's window. Default value = -1 |
Top |
Optional. A long integer value. The top coordinate of the search area the object's window. Default value = -1 |
Right |
Optional. A long integer value. The right coordinate of the search area within the object's window. Default value = -1 |
Bottom |
Optional. A long integer value. The bottom coordinate of the search area a within the object's window. Note: If the Left, Top, Right, and Bottom arguments are not specified, the method returns all of the text within the visible part of the specified object. Default value = -1 |
Return Type
A String value.
IMPORTANT
- The text to capture must be visible in the application window when the step runs.
- The area is defined by pairs of coordinates that designate two diagonally opposite corners of a rectangle.
- The results of this method may be different depending on the settings selected in the Text Recognition pane of the Options dialog box (Tools menu > Options item > GUI Testing tab > Text Recognition node).
- The results of this method may be different in different run sessions depending on the operating system version you are using, service packs you have installed, other installed toolkits, or the APIs used in your application. Therefore, when possible, it is highly recommended to use the GetROProperty Method to retrieve the value of the text (or equivalent) property from an object in your application instead of using the GetVisibleText method.
- By default, when UFT One captures text for a text/text area checkpoint or output value step using the GetText, GetTextLocation, or GetVisibleText methods, it tries to retrieve the text directly from the object using a Windows API-based mechanism. If UFT One cannot capture the text this way (for example, because the text is part of a picture), it tries to capture the text using an OCR (optical character recognition) mechanism. For details about changing this behavior, see the Can QuickTest Professional Text Recognition behavior be modified Knowledgebase article (number KM202721).
Example
'This example uses the GetVisibleText method to retrieve the text from the "Form1" window. If the returned 'string contains the "login": sub-string, the Type method is used to type the "guest" string in the window. TestText = SwfWindow("Form1").GetVisibleText IfInStr(1, TestText, "login:", 1) > 0 Then SwfWindow("Test").Type "guest"EndIf
'This example uses the GetVisibleText method to retrieve the text within the specified coordinates. If 'the returned string is not Catalog, the ReportEvent method is used to report a failed step. theText = SwfWindow("Form1").SwfObject("progressBar1").GetVisibleText(16, 25, 56, 92) If theText <> "Catalog"Then Reporter.ReportEvent micFail, "Traders", "Text check failed"EndIf
GroupByColumn Method
Description
Group table rows according to the specified column.
Syntax
object.GroupByColumn Column
Arguments
Parameter | Description |
---|---|
Column |
Required. A Variant. The location of the column within the grid.
The value can be the column index (0-based number) or column caption (string).
|
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the GroupByColumn method to group the "gridControl1" table by the first Column, then 'selects the "Category" column and groups the grid according to the "Category" column. SwfWindow("DevExpress Controls").SwfTable("gridControl1").GroupByColumn 0 SwfWindow("DevExpress Controls").SwfTable("gridControl1").GroupByColumn "Category"
HideColumn Method
Description
Hides the specified column.
Syntax
object.HideColumn column
Arguments
Parameter | Description |
---|---|
Column |
Required. A Variant. The location of the column within the grid.
The value can be the column index (0-based number) or column caption (string).
|
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the HideColumn method to hide the first column and the column named 'ID'.
SwfWindow("DevExpress Controls").SwfTable("gridControl").HideColumn 0
SwfWindow("DevExpress Controls").SwfTable("gridControl").HideColumn "ID"
HideParentRow Method
Description
Hides the parent row, when the child grid is displayed.
Syntax
object.HideParentRow
Return Type
None.
IMPORTANT
This method is supported only for Microsoft Data Grid controls.
You can use the OpenCellRelation method to display the child table of a selected cell. You can use the ShowParentRow method to display a hidden parent row.
Example
'This example uses the HideParentRow method to hide the parent row, after the second row of the '"myDataGrid" control is expanded to display a cell relation. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 1 SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 1, 0 SwfWindow("DataGrid Control").SwfTable("myDataGrid").HideParentRow
HideRow Method
Description
Hides the specified row.
Syntax
object.HideRow rowPath
Arguments
Parameter | Description |
---|---|
rowPath | Required. A String. The path to the location of the row within the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the HideRow method to hide a row in the grid.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").HideRow "Path;(Color;Size)"
IsRowSelected Method
Description
Indicates whether the specified row is selected.
Syntax
object.IsRowSelected row
Arguments
Parameter | Description |
---|---|
row | A row of Variant type. |
Return Type
A Boolean value.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the IsRowSelected method to check whether a row in the grid is selected.
If SwfWindow("DevExpress Controls").SwfTable("GridControl").IsRowSelected(2) Then
MsgBox "Row 2 is selected."
End If
MakeCellVisible Method
Description
Scrolls the specified cell into view if it is not visible in the grid.
Syntax
object.MakeCellVisible Row, Column
Arguments
Parameter | Description |
---|---|
Row | Required. A Variant. The location of the row within the grid.
|
Column |
Required. A Variant.
|
Return Type
None
Example
'This example uses the MakeCellVisible method to scroll the cell located 'in the ninth row, third column of the "myDataGrid" table into the view. SwfWindow("DataGrid Control Sample").SwfTable("myDataGrid").MakeCellVisible 8, 2
MouseMove Method
Description
Moves the mouse pointer to the designated position over the object.
Syntax
object.MouseMove X, Y
Arguments
Parameter | Description |
---|---|
X | Required. An integer value. The position of the mouse pointer, expressed as x-coordinates (in pixels). Note that the specified coordinates are relative to the upper left corner of the object. |
Y | Required. An integer value. The position of the mouse pointer, expressed as y-coordinates (in pixels). Note that the specified coordinates are relative to the upper left corner of the object. |
Return Type
None
Example
'This example uses the MouseMove method to move the mouse pointer to position 10, 5 inside the '"progressBar1" object. SwfWindow("Form1").SwfObject("progressBar1").MouseMove 10, 5
MoveColumn Method
Description
Moves the specified column to the specified destination column's position.
Syntax
object.MoveColumn sourceColumn, desntinationColumn, [insertAfter]
Arguments
Parameter | Description |
---|---|
sourceColumn | Required. A Variant. The location of the column to move within the grid. The value can be the column index (0-based number) or column caption (string). |
destinationColumn | Required. A Variant. The new location for the column within the grid. The value can be the column index (0-based number) or column caption (string). |
insertAfter | Optional. A Boolean. Indicates whether to insert the column in the grid after the specified destination column. Default=false. The column is inserted before the specified column. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the MoveColumn method to move columns around inside the grid.
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn 0, 1
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn 0, 1, True
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn 2, "Discount"
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn "ID", 1
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn "ID", 1, True
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn "ID", "Price"
SwfWindow("DevExpress Controls").SwfTable("gridControl").MoveColumn "ID", "Price", True
MoveRow Method
Description
Moves the specified row.
Syntax
object.MoveRow sourceRowPath, destinationRowPath, moveOptions
Arguments
Parameter | Description |
---|---|
sourceRowPath | Required. A String. The path to the location of the row to move within the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
destinationRowPath | Required. A String. The path to the new location of the row within the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
moveOptions | Required. An Integer. Indicates where to place the moved row relative to the specified destination. Possible values: 0 - MoveBefore. Place the moved row before the specified destination row. 1 - MoveToChildren. Place the moved row as a child of the specified destination row. 2 - MoveAfter. Place the moved row after the specified destination row. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the MoveRow method to move the 'Quantity' row after the Product row,
' move the 'ID' row before the 'Product' row, and move the 'Line' row to be a child of the 'Model' row.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").MoveRow "Quantity", "Product", 2
SwfWindow("DevExpress Controls").SwfTable("vGridControl").MoveRow "ID", "Product", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").MoveRow "Line", "(Description;Model)", 1
OpenCellElement Method
Description
Selects the specified cell and opens a cell's pop-up cell element.
Syntax
object.OpenCellElement Row, Column
Arguments
Parameter | Description |
---|---|
Row |
Required. A Variant. The 0-based row number. |
Column |
Required. A Variant. The location of the column within the grid.
The value can be the column index (0 -based number) or column caption (string).
|
Return Type
None.
IMPORTANT
This method is supported only for ComponentOne C1FlexGrid and C1TrueDBGrid controls.
Example
'This example uses the OpenCellElement method to open the Color dialog box for the selected cell 'element. SwfWindow("Form1").SwfTable("fg").SelectCell 4, "Color" SwfWindow("Form1").SwfTable("fg").OpenCellElement 4, "Color" SwfWindow("Form1").Dialog("Color").WinButton("OK").Click
OpenCellRelation Method
Description
Opens the child table referenced by the link in the specified cell.
Syntax
object.OpenCellRelation Row, Column
Arguments
Parameter | Description |
---|---|
Row |
Required. A Variant. The 0-based row number. |
Column |
Required. A Variant. The 0-based column number. |
Return Type
None.
IMPORTANT
This method is supported only for Microsoft Data Grid controls.
Example
'This example uses the OpenCellRelation method to open the cell relation for the second row and 'first column in the grid, after expanding the second row of the "myDataGrid" control. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 1 SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 1, 0
OpenSummaryDlg Method
Description
Opens the summary dialog box for the specified column.
Syntax
object.OpenSummaryDlg Level, Column
Arguments
Parameter | Description |
---|---|
Level |
Required. A Variant. The band level for which you want to open the dialog box. |
Column |
Required. A Variant. The column header name or the column index (0-based). |
Return Type
None.
IMPORTANT
This method is supported only for Infragistics UltraWinGrid controls.
Example
'This example uses the OpenSummaryDlg method to display the summary dialog for the "Description" 'column in the third band level, after selecting the count check box in the Select Summaries window. SwfWindow("V2 Summary Rows").SwfWindow("Select Summaries").SwfCheckBox("Count").Set "ON" SwfWindow("V2 Summary Rows").SwfWindow("Select Summaries").SwfButton("OK").Click SwfWindow("V2 Summary Rows").SwfTable("UltraGrid1").OpenSummaryDlg 2, "Description"
SelectCell Method
Description
Selects (clicks) the specified cell in a grid.
Syntax
object.SelectCell Row, Column
For DevExpress Vertical Grid: object.SelectCell rowPath, recordIndex, [cellCaption]
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
Column/recordIndex | Required. A Variant. The location of the column within the grid. In most cases, the column header name (string) or the column index (0-based number).
|
cellCaption | Optional. A String. The caption of the cell within a multi-editor row in the grid. Relevant for multi-editor rows in DevExpress Vertical Grids. If not specified, the first cell in the record is used. |
Return Type
None
Example
'This example uses the SelectCell method with Infragistics UltraWinGrid control to select the cell 'in the first row of the "Description" column in the second band level, and then select the cell in the second row 'of the "Quantity" column in the third band level. SwfWindow("V2 Summary Rows").SwfTable("UltraGrid1").ExpandRow "0;0" SwfWindow("V2 Summary Rows").SwfTable("UltraGrid1").SelectCell "0;0", "Description" SwfWindow("V2 Summary Rows").SwfTable("UltraGrid1").SelectCell "0;0;1", "Quantity"
'This example uses the SelectCell method with DevExpress Pivot Grid control to select the cell in the 'third row of the second column, and then select the cell in the second row of the third column. SwfWindow("DevExpress Controls").SwfTable("pGridControl1").SelectCell 2, 1 SwfWindow("DevExpress Controls").SwfTable("pGridControl1").SelectCell 1, 2
'This example uses the SelectCell method with DevExpress DataGrid control to select the cell in the 'third row of the "CustomerID" column, and then select the cell in the second row of the third column. SwfWindow("DevExpress Controls").SwfTable("gridControl1").SelectCell 2, "CustomerID" SwfWindow("DevExpress Controls").SwfTable("gridControl1").SelectCell 1, 2
'This example uses the SelectCell method with ComponentOne C1FlexGrid control to select the cell in 'the fifth row of the "Currency column", and then select the cell in the sixth row and first column. SwfWindow("Form1").SwfTable("fg").SelectCell 4, "Currency" SwfWindow("Form1").SwfTable("fg").SelectCell 5, 0
'This example uses the SelectCell method to select the first cell in the Path row
'in a DevExpress Vertical Grid and then to select the Size part of the first cell in the
'House multi-editor row.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectCell "Path", 0
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectCell "House;(Color;Size)", 0, "Size"
SelectColumn Method
Description
Selects (clicks) the specified column header in a grid.
Syntax
object.SelectColumn Column
Arguments
Parameter | Description |
---|---|
Column |
Required. A Variant. The location of the column within the grid.
For Microsoft DataGrid, specify the column by its 0-based column index.
For Infragistics UltraWinGrid, use the format: n;name
where n is the band level (0-based) and name is the column header name or the column index (0-based).
For other grids, the value can be the column index (number) or column caption (string).
|
Return Type
None
IMPORTANT
This method is not supported for DevExpress Data Grid, Pivot Grid and Vertical Grid controls.
Example
'This example uses the SelectColumn method to select the "Freight" column. SwfWindow("DevExpress Controls").SwfTable("GridControl1").SelectColumn "Freight"
SelectRow Method
Description
Selects the specified row.
Syntax
object.SelectRow Row
For DevExpress Vertical Grid: object.SelectRow rowPath
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
Return Type
None
Example
'This example uses the SelectRow method with DevExpress Data Grid control to select the seventh row. SwfWindow("DevExpress Controls").SwfTable("gridControl1").SelectRow 6
'This example uses the SelectRow method with Infragistics UltraWinGrid control to select the second 'row in the third band level, and then select the second row in the first band level. SwfWindow("Samples Explorer").SwfWindow("View Styles").SwfTable("UltraGrid1").SelectRow "1;0;1" SwfWindow("Samples Explorer").SwfWindow("View Styles").SwfTable("UltraGrid1").SelectRow 1
'This example uses the SelectRow method with ComponentOne C1FlexGrid control to select the eighth row 'in the "fg" table. SwfWindow("Form1").SwfTable("fg").SelectRow 7
'This example uses the SelectRow method to select the 'Full Name' row in a DevExpress Vertical Grid.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SelectRow "Path;Full Name"
SetCellData Method
Description
Sets the contents of a cell with the specified string.
Syntax
object.SetCellData Row, Column, Data, [Type]
For DevExpress Vertical Grid: object.SetCellData rowPath, recordIndex, data
Arguments
Parameter | Description |
---|---|
Row/rowPath | Required. A Variant. The location of the row within the grid.
|
Column/recordIndex | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the column index (0-based number). For Microsoft DataGrids and DevExpress Pivot Grids: The 0-based column index (number). For DevExpress Vertical Grids: The 0-based record index (number). |
Data |
Required. A String value. The contents to be entered into the specified cell. For dimmed check boxes, specify the value: NULL (without quotes). |
Type |
Optional. A Boolean value. Relevant only for ComponentOne C1FlexGrid and C1TrueDBGrid controls: Indicates whether the data is entered into the cell by typing. Possible values: True: Types the data into the cell one character at a time. False: (default) Enters the complete string into the cell.
Default value = False |
Return Type
None.
IMPORTANT
This method is recorded only after you move the focus from the edited cell to another cell.
Example
'This example uses the SetCellData method with ComponentOne C1FlexGrid control to select the check 'box (sets the value as True) in the fifth row of the "Boolean" column. SwfWindow("Form1").SwfTable("fg").SelectCell 4, "Boolean" SwfWindow("Form1").SwfTable("fg").SetCellData 4, "Boolean", "True" SwfWindow("Form1").SwfTable("fg").SelectCell 4, "Currency" SwfWindow("Form1").SwfTable("fg").SetCellData 4, "Boolean", "True" SwfWindow("Form1").SwfTable("fg").SetCellData 4, "Currency", True SwfWindow("Form1").Dialog("#32770").WinButton("OK").Click
'This example uses the SetCellData method with Infragistics UltraWinGrid control to set the value '21 in the second row of the "Shuttle_ID" column in the first band level, and then set the value 7/29/2027 12:00:00 AM in the first row of the Arrival_Date column in the second band level. SwfWindow("View Styles").SwfTable("UltraGrid1").SelectCell 1, "Shuttle_ID" SwfWindow("View Styles").SwfTable("UltraGrid1").SetCellData 1, "Shuttle_ID", "21" SwfWindow("View Styles").SwfTable("UltraGrid1").ExpandRow 3 SwfWindow("View Styles").SwfTable("UltraGrid1").SelectCell "3;0", "Arrival_Date" SwfWindow("View Styles").SwfTable("UltraGrid1").SetCellData "3;0", "Arrival_Date", "7/29/2027 12:00:00 AM"
'This example uses the SetCellData method with Microsoft Data Grid control to open a cell relation 'and set the value 3/2/2003 12:00:00 AM in the first row and third column of the opened child table. SwfWindow("Form1").SwfTable("myDataGrid").ExpandRow 2 SwfWindow("Form1").SwfTable("myDataGrid").OpenCellRelation 2, 0 SwfWindow("Form1").SwfTable("myDataGrid").SelectCell 0, 2 SwfWindow("Form1").SwfTable("myDataGrid").SetCellData 0, 2, "3/2/2003 12:00:00 AM"
'This example uses the SetCellData method to enter data in the first row of a Pivot Grid control,
'in the first column and in the fourth column.
SwfWindow("DevExpress Controls").SwfTable("pGridControl").SetCellData 0, 0, "myData"
SwfWindow("DevExpress Controls").SwfTable("pGridControl").SetCellData 0, 3, "True"
'This example uses the SetCellData method to enter data in the first row of a Data Grid control,
'in the first column and in the column named "ID".
SwfWindow("DevExpress Controls").SwfTable("gridControl").SetCellData 0, 0, "myData"
SwfWindow("DevExpress Controls").SwfTable("gridControl").SetCellData 0, "ID", "True"
'This example uses the SetCellData method to enter data in the Size row of a Vertical Grid control,
'in the first record.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SetCellData "House;(Color;Size)", 0, "myData"
SetMultiCellData Method
Description
Sets the contents of a cell in a multi-editor row with the specified string.
Syntax
object.SetMultiCellData rowPath, recordIndex, cellCaption, data
Arguments
Parameter | Description |
---|---|
rowPath | Required. A String. The path to the row's location within the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
recordIndex | Required. An Integer. The 0-based record index of the column within the grid. |
cellCaption | Required. A String. The caption of the cell within the multi-editor row in the grid. |
data |
Required. A String value. The contents to be entered into the specified cell. |
Return Type
None.
IMPORTANT
This method is supported only on DevExpress Vertical Grid controls.
Example
'This example uses the SetMultiCellData method to set data in the Description part of the first cell in the multi-editor ID grid row.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").SetMultiCellData "(ID;Description)", 0, "Description", "myData"
SetFilter Method
Description
Applies the specified filter string to the specified column.
Syntax
object.SetFilter Level, Column, Value
Arguments
Parameter | Description |
---|---|
Level |
Optional. A Variant. The band level. |
Column |
Required. A Variant. The location of the column within the grid.
For Infragistics UltraWinGrid, use the format: n;name
where n is the band level (0-based) and name is the column header name or the column index (0-based).
For ComponentOne grids, the value can be the column index (number) or column caption (string).
The column index (number) or column caption (string). |
Value |
Required. A Variant.
The filter name or a string defining the filter.
|
Return Type
None.
IMPORTANT
This method is supported only for Infragistics UltraWinGrid, ComponentOne C1FlexGrid, and ComponentOne C1TrueDBGrid controls.
Example
'This example uses the SetFilter method with Infragistics UltraWinGrid control to apply the Fester 'filter to the "FirstName" column in the first band level, and then apply the (Custom) filter to the same column. SwfWindow("Row Filtering").SwfTable("UltraGrid1").SetFilter 0, "FirstName", "Fester" SwfWindow("Row Filtering").SwfTable("UltraGrid1").SetFilter 0, "FirstName", "(Custom)" SwfWindow("Row Filtering").SwfWindow("Enter filter").SwfButton("Cancel").Click
'This example uses the SetFilter method with ComponentOne C1TrueDBGrid control to apply the WELLI 'filter to the "CustomerID" column. SwfWindow("Form1_2").SwfTable("c1TrueDBGrid1").SetFilter "CustomerID", "WELLI"
SetSelection Method
Description
Sets a rectangle-shaped selection.
Syntax
object.SetSelection X, Y, Width, Height
Arguments
Parameter | Description |
---|---|
X | Required. An Integer. The 0-based row index of the cell at the top left corner of the rectangle to select. |
Y |
Required. An Integer. The 0-based column index of the cell at the top left corner of the rectangle to select. |
Width | Required. An Integer. The positive width of the rectangle to select (in cells). |
Height | Required. An Integer. The positive height of the rectangle to select (in cells). |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Pivot Grid controls.
Example
'This example uses the SetSelection method to select the top left corner of the table,
'including the first three cells of the first three rows.
SwfWindow("DevExpress Controls").SwfTable("pivotGridControl").SetSelection 0, 0, 3, 3
SetView Method
Description
Expands the parent rows of the specified view and makes it the current view.
Syntax
object.SetView(ViewPath)
Arguments
Parameter | Description |
---|---|
ViewPath | Required. A Variant. The hierarchical path of the view you want to display in the format:
" Example: " Row numbers in each table are 0-based. An empty string denotes the main (top-level) view. |
Return Type
None.
IMPORTANT
A SetView "" statement (with an empty string argument) must be used before the first operation on an XtraGrid table. When you record, this statement is added automatically for the first XtraGrid table in your test. If your test contains steps on more than one XtraGrid table, ensure that you add a SetView"" statement before the first step on each grid.
This method is supported only for DevExpress grid controls.
Example
'The following example uses the SetView method to set the view to the main (top-level) view.
SwfWindow("MasterView").SwfTable("gridControl1").SetView ""
'The following example uses the SetView method to set the view to the fifth row in the "Orders" view to select
'a cell in that view. It then sets the view to the fifth row in the OrderDetails view (which is a child table
'of the Orders view) to select a cell in that view.
SwfWindow("MasterView").SwfTable("gridControl1").SetView "4 Orders;"
SwfWindow("MasterView").SwfTable("gridControl1").SelectCell 3, "EmployeeID"
SwfWindow("MasterView").SwfTable("gridControl1").SetView "4 Orders;4 OrderDetails;"
SwfWindow("MasterView").SwfTable("gridControl1").SelectCell 0, "ProductID"
'The following example uses the ShowParentRow method to display the parent row. In the example, the second row
'of the "myDataGrid" control is initially expanded to display a cell relation, and then the parent row is hidden
'using the HideParentRow method.
SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 1
SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 1, 0
SwfWindow("DataGrid Control").SwfTable("myDataGrid").HideParentRow
'..
'..
SwfWindow("DataGrid Control").SwfTable("myDataGrid").ShowParentRow
ShowColumn Method
Description
Makes the specified column visible in the grid.
Syntax
object.ShowColumn columnName
Arguments
Parameter | Description |
---|---|
ColumnName |
Required. A String. The caption of the column to show. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the ShowColumn method to show the column named 'ID'.
SwfWindow("DevExpress Controls").SwfTable("gridControl").ShowColumn "ID"
ShowParentRow Method
Description
Displays the parent row, when the child grid is displayed.
Syntax
object.ShowParentRow
Return Type
None.
IMPORTANT
This method is supported only for Microsoft Data Grid controls. You can use the SwfTable.OpenCellRelation method to display the child table of a selected cell. You can use the SwfTable.HideParentRow method to hide a displayed parent row.
Example
'This example uses the ShowParentRow method to display the parent row. In the example, the second row 'of the "myDataGrid" control is initially expanded to display a cell relation, and then the parent row is hidden 'using the HideParentRow method. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ExpandRow 1 SwfWindow("DataGrid Control").SwfTable("myDataGrid").OpenCellRelation 1, 0 SwfWindow("DataGrid Control").SwfTable("myDataGrid").HideParentRow '.. '.. SwfWindow("DataGrid Control").SwfTable("myDataGrid").ShowParentRow
ShowRow Method
Description
Makes the specified row visible in the grid.
Syntax
object.ShowRow rowPath
Arguments
Parameter | Description |
---|---|
rowPath | Required. A String. The path to the location of the row within the grid. Separate nested or multi-editor row names with semicolons(;). For example: "Price;Full Name;Category;Color" |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Vertical Grid controls.
Example
'This example uses the ShowRow method to make a hidden row in the grid visible.
SwfWindow("DevExpress Controls").SwfTable("vGridControl").ShowRow "Path;(Color;Size)"
Sort Method
Description
Sorts the table contents according to the specified column.
Syntax
object.Sort Level, Column, Order
Arguments
Parameter | Description |
---|---|
Level |
Required. A Variant. Relevant only for Infragistics UltraWinGrid controls:
The band level for which you want to open the dialog box.
|
Column | Required. A Variant. The location of the column within the grid. Specify the column header name (string) or the column index (0-based). For Microsoft DataGrid, specify the column by its 0-based column index. |
Order |
Required. A Variant. For Infragistics UltraWinGrid controls:
The sorting order.
Possible values: "Ascending" "Descending" (default) Note: The value may also be a numeric code representing special sort options.
|
Return Type
None.
IMPORTANT
This method is supported only for Infragistics UltraWinGrid, ComponentOne C1FlexGrid, and ComponentOne C1TrueDBGrid controls.
Example
'This example uses the Sort method with Infragistics UltraWinGrid control to sort the first band level 'according to the "Name" column in ascending order. It then expands the second band level to sort the third band 'level according to the "First_Name" column in ascending order. SwfWindow("View Styles").SwfTable("UltraGrid1").Sort 0, "Name", "Ascending" SwfWindow("View Styles").SwfTable("UltraGrid1").ExpandRow 1 SwfWindow("View Styles").SwfTable("UltraGrid1").ExpandRow "1;0" SwfWindow("View Styles").SwfTable("UltraGrid1").Sort 2, "First_Name", "Ascending"
'This example uses the Sort method with ComponentOne C1FlexGrid control to sort the table according 'to the "Last Mod" column in ascending order, and then sorts the table according to the "Name" column in descending 'order. SwfWindow("C1FlexGrid:").SwfTable("_flex").Sort "Last Mod", "Ascending" SwfWindow("C1FlexGrid:").SwfTable("_flex").Sort "Name", "Descending"
Type Method
Description
Types the specified string in the object.
Syntax
object.Type KeyboardInput
Arguments
Parameter | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
KeyboardInput |
Required. A String value.
The text string and/or constants representing non-alphanumeric keys.
The following constants are available:
|
Return Type
None
IMPORTANT
Although the Type method is supported for most objects, if you enter a Type statement for an object in which a user cannot enter text, the method has no visual effect.
Example
'This example uses the Type method to press the ENTER (RETURN) key on the button4 button. SwfWindow("Form1").SwfButton("button4").Type micReturn
UnGroupByColumn Method
Description
Ungroups table rows according to the specified column.
Syntax
object.UnGroupByColumn columnName
Arguments
Parameter | Description |
---|---|
ColumnName |
Required. A String. The column caption. |
Return Type
None.
IMPORTANT
This method is supported only for DevExpress Data Grid controls.
Example
'This example uses the GroupBy method to group the "gridControl1" table by the "Supplier" Column, then 'selects the "Category" column and then ungroups the "Supplier" grouping. SwfWindow("DevExpress Controls").SwfTable("gridControl1").GroupByColumn "Supplier" SwfWindow("DevExpress Controls").SwfTable("gridControl1").UnGroupByColumn "Supplier"
ColumnCount Property
Description
Returns the number of columns in the grid.
Syntax
object.ColumnCount
Value Type
An integer value.
Property type
Read-only property
IMPORTANT
In UltraWinGrid controls, this property returns the number of columns in the current band.
This method is not supported for DevExpress grid controls. For DevExpress Data Grid and DevExpress Pivot Grid controls, use the GetColumnsCount Method instead.
RowCount Property
Description
Returns the number of rows in the grid.
Syntax
object.RowCount
Value Type
A long integer value.
Property type
Read-only property
IMPORTANT
In UltraWinGrid controls, this property returns the number of rows in the current band.
This method is not supported for DevExpress grid controls. Use the GetRowsCount Method instead.
See also: