Forum Discussion

fmendes's avatar
fmendes
Contributor
14 years ago

C1FlexGrid Help

I am working with C1FlexGrid. I am able to select a row and column, hove over the row and column... i.e. lets say on my screen I currently see columns 1-7. I can programatically select col 11, make it display on the screen, hove the mouse over it. However when I try to click on a cell on column 11 I get an error saying "There was an attempy to perform an action at a point, which is beyond the screen."

I don't understand why since I am able to programatically scroll to the column, select, hove over to show a tooltip, but cannot click on it!

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Luis,


    Can you post here the code that causes the problem? In other words, I wanted to know exactly how you are trying to click this cell from your script.


    Thanks.




  • I also tried the code below from your example. The problem comes if the C1Flexgrid is loaded and the Column I want to click is not currently visible. In your example you are passing column #5, but lets say that you want column 20 which would require you to scroll. Either the cold below before the click to bring the cell to view or the code - wGrid.Select_7(rowId, colId, true); will do the trick, BUT as soon as the click event is called I get the error message.


    //Code copied from (http://smartbear.com/support/viewarticle/8973/?FullScreen=1)


    Thanks for the reply.
  • I have attached a VisualStudio project with C1FlexGrid. See below the code copied from the sample provided (http://smartbear.com/support/viewarticle/8973/?FullScreen=1)






    function


     



    clickCell()



    {



        var wGrid =


     


    Sys.Process("FlexGridTestCompleteTest").WinFormsObject("Form1").WinFormsObject("c1FlexGrid1");



    var rowId = 5;



      var colId = 48;



     


     


    //Check the range





      var rowCount = wGrid.Rows.Count;   



      if (rowId < 1 || rowId > rowCount - 1)



      {



       


     


    Log.Error("Wrong row index.");



        return false;  



      }



      



      colCount = wGrid.Cols.Count;



      if (colId < 1 || colId > colCount - 1)



      {



       


     


    Log.Error("Wrong column index.");



        return false;  



      }



     



     


     


    //Bring the cell to view  





      wGrid.Col = colId                   



      wGrid.TopRow = rowId + wGrid.TopRow - wGrid.BottomRow + 1



     



      var oRow = wGrid.Rows.Item(rowId - wGrid.TopRow + 1)  



      var oCol = wGrid.Cols.Item(colId - wGrid.LeftCol + 1)



      if (rowId < rowCount - 1)



      {



        yPos = oRow.Top + oRow.HeightDisplay / 2



      }



      else



      {



        yPos = oRow.Top



      }



      



     


     


    //Perform a click





     


     


    Log.LockEvents(1);



     



      wGrid.Click(oCol.Left + oCol.WidthDisplay / 2, yPos);



     


     


    Log.UnlockEvents();



     


     


    Log.Event("The [" + rowId + ", " + colId + "] cell was clicked."); 



      return true;    



    }

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Luis,


    To help us investigate the problem, please contact our Support Team and send them the following information:

    1. Your TestComplete project.

    2. A sample application along with the C1FlexGrid control that they can use to reproduce the behavior.


    Thanks.