We are trying to get the amount of rows in a
DataGridView. However, when using the following code to try to get the
DataGridView we are getting a DateTimePicker object instead. We have also tried the
Table ae = window.Get(SearchCriteria.ByAutomationId ("myGridString")) as Table;
// editLinksWindow.Get(SearchCriteria.ByAutomationId ("myGridString")) Returns a DateTimePicker object
Then we tried the following to work around this with no luck:
Cast the DataGridView as a
ListView (same result as above).
Using the AutomationElement, and then trying to find its children based on the caption each row has on screen (we have used other properties such as
ClassName property with “DataGridRow” or “ListViewItem” as caption):
AutomationElement ae = window.Get(SearchCriteria.ByAutomationId ("myGridString")).AutomationElement;
AutomationElementCollection aeChildren = ae.FindAll (TreeScope.Descendants, new PropertyCondition (AutomationElement.NameProperty, "CellCaption"));
We are certain this is a
DataGridView it is the object we can see it in the VisualStudio designer. The
AutomationID and Text property are also correct.
OS: Windows Vista, Windows XP.
White version 0.1.5.0.
Visual Studio 2008 SP1.
We would appreciate if someone could provide some insight on this.