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

Dynamic Grid Not working

1 Answer 63 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jin
Top achievements
Rank 1
Jin asked on 23 May 2013, 03:02 PM
Hello,

I am trying to following the tutorial in the documentation: http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/html/dynamic-grid.aspx

1. I first navigate to the site http://demos.telerik.com/aspnet-ajax/grid/examples/client/selecting/defaultcs.aspx
2. Then I add GridTableView to project element
3. I added a code step with the code:

foreach (HtmlTableRow r in Pages.ClientSideRowSelection.TemporaryRadGridTable1)
            {
                foreach(HtmlTableCell c in r.Cells)
                {
                    Log.WriteLine("Cell found. TextContent:"+c.TextContent);
                }
            }

Then when I run the test, I get an error in the log saying: "......DynamicGridTest.tstest.cs: Line 78: (CS1579) foreach statement cannot operate on variables of type 'Telerik.WebAii.Controls.Html.GridTableView' because 'Telerik.WebAii.Controls.Html.GridTableView' does not contain a public definition for 'GetEnumerator'"

How do I solve this problem?

Thanks



-------------------------------------

never mind, solved.

1 Answer, 1 is accepted

Sort by
0
Mario
Telerik team
answered on 24 May 2013, 09:33 PM
Hi Jin,

Thank you for contacting Telerik Support.

Please make the following minor change (highlighted below) to rid yourself of this error:

foreach (HtmlTableRow r in Pages.ClientSideRowSelection.TemporaryRadGridTable1.AllRows)
            {
                foreach(HtmlTableCell c in r.Cells)
                {
                    Log.WriteLine("Cell found. TextContent:"+c.TextContent);
                }
            }


Regards,
Mario
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Jin
Top achievements
Rank 1
Answers by
Mario
Telerik team
Share this question
or