Dynamic Grid Not working

2 posts, 0 answers
  1. Jin
    Jin avatar
    1 posts
    Member since:
    May 2013

    Posted 23 May 2013 Link to this post


    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?



    never mind, solved.
  2. Mario
    Mario avatar
    8 posts

    Posted 24 May 2013 Link to this post

    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);

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top