This project is read-only.

Not able to access the Rows in a DataGird

Jan 21, 2009 at 6:16 AM
Hi there,

I have a application with couple of dataGrids in application.It is a simple win form application. Now when I tried to find the control using the Table control I am not able to access the rows. It gives an exception "Bricks.BricksException with error "Error invoking Table.get_Rows", and inner exception as "Object reference not set to an instance of an object"

I used the folloiwng line to access the datagrid:



templateMetadataFields = newMetadataFromTemplate.Get<Table>("dataGridViewMetadataFieldItems");
If I use List view (seen from other threads) instead of table, the above statement returns null.

Any pointers are appreciated.



Jan 21, 2009 at 10:14 PM
I believe that some versions of Windows have problems accessing DataGrids and MenuBars from UI Automation - there have been previous discussions here to that effect.
However, if you are using NUnit to run tests, it may be an issue with NUnit running multiple threads - this page shows how to set up your test app.config so that NUint uses single threaded apartment, which should resolve any NUnit threading issues.
Jan 22, 2009 at 9:23 AM
I use russian version of Windows OS. In this version I have problem with DataGrid. I research this problem and find reason. When White try get rows of DataGrid, at first it try get Header of  Table. For this it search for descendant which name starts with "Top Row ". But in russian version name of this descendant starts with "Верхняя строка " and white found 0 descendant and can not create TableHeader and TableRows.
Jan 26, 2009 at 2:57 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.