Forum Discussion

sivakarthik's avatar
sivakarthik
Contributor
6 years ago

grid column width

hello Community members,

 

good evening,  I am loking for a way to get the grid header column width. I have searched in the test complete help, I found the Itembound but its not working for me.

 

i. Is there a way to get the column header width and also focused row index ?

 

for focused row index I haved tried the FocusedRowIndex property but its not working any ideas please ?

 

Thanks and Regards

SivaKartheek Sreeram

4 Replies

  • cunderw's avatar
    cunderw
    Community Hero

    What type of application / grid? What do the object properties look like in the object browser?

    • sivakarthik's avatar
      sivakarthik
      Contributor

      I am using the TcxGridSite, attached the pic have a look in the properties 

       

      thanks and Regards

      SivaKartheek

  • anupamchampati's avatar
    anupamchampati
    Frequent Contributor

    I was too facing the same problem with TcxGridSite but could not found any to click on the filter, Smart Bear support team asked me to use hardcoded click(x , y) which we get from record scripts.

    But I think this way you can click on the specific cell from the Grid and get the row index as well.

     

    function ClickGrid(Grid,Column,Value)
    {

    // GRID param should be the parent object of TCXGRIDSITE

    var RowIndex;
    function FindRow(Grid, Column, Value, ViewId)
    {
    if (typeof(ViewId) == "undefined")
    ViewId = 0;
    for (var i=0; i<Grid.wRowCount(ViewId); i++)
    if (Grid.wValue(i, Column, ViewId) == Value)
    return i;
    return -1;
    }
    RowIndex = FindRow(Grid,Column,Value);
    if (RowIndex != -1)
    {
    Grid.ClickCell(RowIndex, Column);
    Log.Message("Row index: " + RowIndex + " Column Name: " + Value);
    }
    else
    Log.Error("Row was not found");

    • sivakarthik's avatar
      sivakarthik
      Contributor

      hi Anupam,

       

      any how thanks for your suggestion, but actually I need the index of the focussed row not by click.

       

      thanks and regards

      SivaKartheek Sreeram