How to read a cell in the Grid control by using WinForms QTP?
You can retrieve the text from the cell by using the GetCellData method or GetFormattedText method by using WinForms QTP.
Using GetCurrentCell()
The GetCurrentCell method retrieves the text of the given cell.
The following code example retrieves the value of the cell [1,1] in the Grid.
VB Script
SwfWindow("Form1").SwfObject("gridControl1").SetCurrentCell 3,1 value = SwfWindow("Form1").SwfObject("gridControl1").GetCellData(1,1) msgbox value
Using GetFormattedText() method
This method retrieves the formatted text of the cell. In the following code example, the formatted text is retrieved of the cell [2,1].
VB Script
value = SwfWindow("Form1").SwfObject("gridControl1").GetFormattedText(2,1) msgbox value
Conclusion
I hope you enjoyed learning about how to read a call in the Grid control by using WinForms QTP.
You can refer to our WinForms QTP feature tour page to know about its other groundbreaking feature representations. You
can also explore our documentation to understand how to present
and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other components.
If you have any queries or require clarifications, please let us know in comments below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!