This is a migrated thread and some comments may be shown as answers.

Silverlight RadGridView not finding all rows or cells

1 Answer 60 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 29 May 2014, 09:46 AM
Hi,
We are trying to verify the contents of a RadGridView, but are not getting the correct number of rows or cells. The code we are using is as follows :

​SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
​Telerik.WebAii.Controls.Xaml.RadGridView rgv = app.Find.ByType<Telerik.WebAii.Controls.Xaml.RadGridView>();

Log.WriteLine(rgv.Rows.Count.ToString());
Log.WriteLine(rgv.Rows[0].Cells.Count().ToString());

Now we could have 500 rows and 5 columns, but the Log just shows the row count to be 2 and cell count to be 1. Any ideas as to why it is not bringing back the full RadGridView ??
As a heads up the RadGridView is being populated by Dynamc Data (as seen in this demo ... http://demos.telerik.com/silverlight/#GridView/DataSources )

Cheers ... Rob.

1 Answer, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 31 May 2014, 11:17 AM
Hello,

That can indeed happen in case of virtualized items control in Silverlight, which is usually the case with RadGridView. Virtualization has been introduced in Silverlight for performance reasons, however it makes the automation quite hard. The problem is items (rows/columns in this case) are not available in the visual tree until you scroll to make them visible (in addition you can't rely on the other of items as you can get them from the visual tree).

Please check this article for example how to accomplish iterating over all items in virtualized GridView. There are a few similar articles in the same section which you may find useful as well.


Regards,
Konstantin Petkov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Rob
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
Share this question
or