TestComplete Tip: (Using the Mouse to Select Rows in DataGridView)

Sometimes there are events attached to certain functions of a DataGridView.  These events will not be triggered by programmatically selecting the row.  

Grid.Rows.Item(Row).Selected = true;

So what can you do about this?  The .NET 2.0 framework includes a very useful property off of most controls called 'AccessibilityObject', the property object contains the screen location for the control.  Since TestComplete contains a method to convert screen coordinates to the control coordinates, it is now easy to make the mouse click and select the rows in the DataGridView and trigger all the normal events.

 


Close

Add a little SmartBear to your life

Stay on top of your Software game with the latest developer tips, best practices and news, delivered straight to your inbox

By submitting this form, you agree to our
Terms of Use and Privacy Policy

Thanks for Subscribing

Keep an eye on your inbox for more great content.

Continue Reading