Getting the Focused Row, Column and Cell in Developer Express XtraGrid

When testing applications that use Developer Express XtraGrid controls,
you may need to know which row, column and cell are currently focused. The
XtraGrid control has special internal properties that let you easily
determine the currently selected element. These properties are listed in the
table below:

Property Description
GridObj.FocusedView Specifies the currently focused grid view. You can use this property, for example, to determine the focused view in the
grid that displays data of multiple nested tables. If the grid displays data
of one table only, this property is always equal to GridObj.MainView.
ViewObj.FocusedRowHandle Specifies the index (zero-based) of the row (card) that is currently selected in the given view.
ViewObj.FocusedColumn Specifies the column (card field) that is currently selected in the given view.

Note that in order for TestComplete to have access to these properties, the
.NET Open Applications plug-in must be installed and enabled.
Below is sample code that demonstrates how you can use these properties to
get the text of the focused cell. The example works with the GridTutorials
demo application that comes with the Developer Express XtraGrid Suite.



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