Forum Discussion

seenamathew's avatar
seenamathew
Occasional Contributor
14 years ago

Get row color of a grid

Hi,

Does testcomplete have any method/property to get the color of a row in grid?



Regards,

Seena

5 Replies

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Seena,



    In most cases TestComplete can provide you with the means to get grid's color. Exact implementation depends on your application (Win32/64, .Net, Silverlight, etc.) and the grid control being used (Telerik, devExpress, ...).

    So you may either provide here the above information and clarification what exact color you are interested in (this may be the color of the grid itself, or the color of grid's item/row, or...) or investigate yourself the properties and methods of the grid and its child elements using the Object Browser to find out the object and properties that provide you the necessary information.
  • seenamathew's avatar
    seenamathew
    Occasional Contributor
    Hi,

    The grid is a dotnet grid(System.Windows.Forms.DataGridView).I want the color of the row of the grid

  • Hi Seena,





    Try using the following script:





        var row = <gridObj>.CurrentRow;

        var style = row.InheritedStyle;

        var size = row.PreferredSize;

        Log.Message(style.BackColor.ToString());




  • murugans1011's avatar
    murugans1011
    Regular Contributor
    Is it possible to get row color of ms flexgrid in vbscript?


    temp= flexgrid.CellBackColor returns some integer values..how it can be converted in to string

    datagrid.CellBackColor=vbRed 'Sets cell red color to cell
    • suganthiRaj's avatar
      suganthiRaj
      New Member

      I am also facing the same issue can't get row back ground color, if anybody find a solution plz share it.