Iterating through grid rows means accessing rows is a series, one by one. You may need to iterate through GridControl rows if you need to locate a particular row in the grid or perform the same set of operations on each row.
You can iterate through the grid rows by organizing a loop. Since the numeration of grid rows and columns is zero-based, the index of the first grid row (column) is 0, and the index of the last row (column) is returned by the
Model.ColCount) property. On each loop iteration, you can perform the desired actions over the current row. For example, you can obtain or modify cell values.
Note that the first rows and columns represent grid headers and do not contain actual data. To determine the indexes of the topmost row and leftmost column that contain data rows, you can use the grid’s
GridCellsRange.Left properties. The
GridCellsRange.Right properties return the indexes of the last data row and column. For more information on addressing GridControl rows and columns, see Accessing Rows, Columns and Cells in Syncfusion GridControl.
||In order for TestComplete to access these properties, the .NET Application Support plug-in must be installed and enabled.
The following example demonstrates how to process GridControl rows in a loop. It iterates through the grid rows, saves the data to an XML file and adds a link to this file in the test log.
View descriptionHide description
The script contains the following routines: