Data grid view problem

Aug 31, 2011 at 5:01 AM
Edited Aug 31, 2011 at 5:02 AM


    I am not able to get the rows,columns and header of the datagrid. I am able to identify datagrid view. Below is my code,

 Table sectionDataGrid;       

 sectionDataGrid = ClientWindow.GetInstance(AppReferenceHolder.GetApplication()).Get<Table>(SearchCriteria.ByText("DataGridView")); // Finds the data grid view  System.Windows.Forms.MessageBox.Show(sectionDataGrid.ToString());                                                                                        // It displays a messagebox for datagridview name 

System.Windows.Forms.MessageBox.Show(sectionDataGrid.Rows.Count.ToString());  //Displays 0 even though there are 3 rows inserted

Also when I try to get the header of the grid view, it throws null reference exception.

Aug 31, 2011 at 12:20 PM

If you're running a non-english version of Windows, it's probably a localization issue.

Aug 31, 2011 at 12:23 PM

Hi ,

Thanks for the response but I am using english version, I am able see the rows and header in the UIA verify, but when I check it in code by putting a break point, table is found but row and header are null.


Thanks in advance

Aug 31, 2011 at 12:33 PM



Is this right that can get row count but not single rows? Is this a WPF Application and the rows and header are custom UIItems?



Aug 31, 2011 at 2:14 PM

In UIVerify, what is the name of the row elements?

Sep 3, 2011 at 6:48 AM

Hi Thondorin and MetaSam,


 Thanks for your valuable response, I am presently at my native place so I'll come back with details of the grid by monday.



Sep 5, 2011 at 7:41 AM

Hi Thondorin and MetaSam,

   It's WinForm, control type is table and it is customized.

  Rows are displayed as Row 0, Row 1 ...

  Top Row under the rows and headers under them.


Thanks in advance.