Forum Discussion

elvira1964's avatar
elvira1964
New Contributor
2 years ago

MyGrid.Cells

Maybe someone can help us.

We have an Object of Type TStringGrid and want to access (read and write) every single cell like in Delphi with MyGrid.Cells[x,y].

We didn't find anything suitable in the TestComplete help.

Note: .Cells[] is not a design-Time property…

 

    • elvira1964's avatar
      elvira1964
      New Contributor

      Thanks for your quick answer, but it doesn't work:

       

      AnzahlZeilen := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.RowCount;//this line works, returns 65
      AnzahlSpalten := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.ColCount;//this line works, returns 7
      BoxValue := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.Cells[1,1]; //doesn't work, unsuccessful waiting for Cells(1,1)

       

       

      Regards,

      Elvira

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Have you tried using round brackets, i.e. Cells(1, 1) ?

  • elvira1964's avatar
    elvira1964
    New Contributor

    Thanks for your very quick answer, but it doesn't work:

     

    yes, I tried with round brackets.

    AnzahlZeilen := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.RowCount;//this linedoesn't work, unsuccessful waiting for PageControl
    AnzahlSpalten := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.ColCount;//this line doesn't work
    BoxValue := Aliases.MyProgName.FSetup.PageControl.tsBoxes.BoxGrid.Cells(1,1); //this line doesn't work

    And I become 

    Regards,

    Elvira

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If you haven't done already, it might be worth having a look at some of the Sample projects given in <TestComplete Samples>\Desktop\Working With Grids\Borland TDBGrid, to see how cell methods are called.