When testing applications that use the QuantumGrid control by Developer Express, you may need to know what row and cell is currently focused. To do this, create a script that will perform the following actions:
- Obtain the currently focused view (to access the focused row, you need to know what view is focused). To do this, use the
FocusedView property of the grid object. It returns the view object that corresponds to the focused grid view.
- Use the
ViewData.Controller.FocusedRowIndex property of the view object to get the index of the focused row among other rows.
- To obtain the index of the focused column, use the view object’s
Note that in order for TestComplete to be able to access these properties, the tested application must be compiled as an Open Application with debug information.
The following code demonstrates how you can use the described properties to obtain the value of the focused cell: