Getting gridheader columns

Oct 22, 2010 at 10:43 AM

  I am trying get the grid headers and click on one of the grid header column, below is the code I wrote.


Table sectionDataGrid = GroupBox4.Get<Table>(SearchCriteria.ByAutomationId("IM_WebForm_Block_IM_WebForm_Id"));

TableColumns addColumns = sectionDataGrid.Header.Columns;   // throws exception at this line when I try to get gridheader colums

TableColumn addColumn = addColumns.ElementAt(0);


When I check the sectionDataGrid.isVisible it is true, so the grid has been identified. And it shows rows=0 but in fact I have 5 gridcolumns. How'd I get those gridcolumns? And I am using WindowsXP , service pack 3.


Thanks in advance.

Oct 22, 2010 at 10:50 AM

WPF or Windform?

have you tried ListView instead of table?



Oct 22, 2010 at 10:52 AM

It's a winform, No I didn't try ListView. One of my friend told me he's able to identify and get the header with the same code I have written on the same application. I am confused about it.