Forum Discussion

anurag_maharshi's avatar
anurag_maharshi
New Contributor
10 years ago

ClickCell method in tcxgrid site is not working properly

Hi,



Clickcell method of tcxgrid is clicking randomly in any row. But it clicks in correct column.

 

My requirement is that i need to click in a cell in the grid and put some values in that.



As it clicks randomly it fills value in any row.



Please let me know how to resolve this issue.



Below is the code that i used.




function FillValueInCellInGrid(cellRowNew,cellColumn,cellValue)


{


Log.Message("Row no passed in function "+cellRowNew)


 


 if(cellValue==undefined || cellValue==null)


 {


 }


 else


 {


 tcxGrid1.ClickCell(cellRowNew, cellColumn);


 Delay(500)


 tcxGridSite1.Keys(cellValue+"[Enter]");


 tcxGrid1.Keys(cellValue+"[Enter]");


 


 }


}



Thanks,

Anurag





2 Replies

  • Hi Tanya,



    By random i means if i send parameter to click on row 1 , it clicks on  any other random row other than 1. 

    I tried to check this code for different type of grid but all of them do the same thing.



    I have resolved this issue by using below code ...( Not using clickcelll method still)








    function FillValueInCellInGrid(tcxGridSite1,cellRowNew,cellColumn,cellValue)


    {


     


     var dc=tcxGridSite1.GridView.DataController


     dc.Controller.SetFocusedRecordIndex(cellRowNew)


     dc.Controller.SetFocusedItemIndex(cellColumn)


    //Log.Message("Row no passed in function "+cellRowNew)


     


    Delay(500);


     if(cellValue==undefined || cellValue==null)


     {


     }


     else


     {


    tcxGridSite1.Keys(cellValue+"[Tab]");


     }


     


    }







  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Anurag,


     


    What do you mean by "it clicks randomly"? Your code looks good. What value do you pass to the FillValueInCellInGrid function.


     


    BTW, did you try using the following approach:




    tcxGrid1.wText(cellRowNew, cellColumn) = cellValue;