When working with QuantumGrid controls, you may need to simulate the selection of several grid rows.
To obtain the selected rows, you can use the following internal methods of the TcxGrid object (TcxGrid is the class name of the QuantumGrid control):
ViewObj.DataController.GetSelectedCount - Returns the number of selected rows. This is a method of the view object (QuantumGrid can display data in several levels. Each level has an associated view object. It specifies what data the level displays and how it displays them).
ViewObj.DataController.GetSelectedRowIndex(SelectedIndex) - Returns the index of the selected row in the grid by its index in the collection of the view’s selected rows.
In order for TestComplete to be able to access the mentioned methods, the application under test must be compiled as an Open Applications with debug information.
Below is a sample script that demonstrates how you can use the internal methods of the QuantumGrid control to access selected rows. The sample code contains the following routines: