Forum Discussion

nyczmagix's avatar
nyczmagix
Occasional Contributor
13 years ago

Infragistics RecordListControl

Hello,


We have a grid created using Infragistics.Windows.DataPresenter.RecordListControl we need to check / enter values into. The RecordListControl's children consists of Infragistics.Windows.DataPresenter.DataRecordPresenter (the rows). This list of DataRecordPresenters, however, changes when I expand a collapsed row in the grid.


Using Object Spy, I do not see a Row / Column extended property available. 


Is there a way to interact with a particular cell (checking it's value and entering values) by referencing it's row / column index?


Thanks.

3 Replies

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Peter,



    Yes, the wValue property returns the value actually stored in the cell, not the displayed formatted value. This is made so that the tests are independent of the grid formatting settings, the computer's locale, and so on.



    To get the display value, you can use xamDataGrid's native methods and properties. I have no available formatted grid example, so I'm not exactly sure, but the following properties and methods seem to be relevant:



      gridObj.Records.Item(row_index).Cells.Item(column_index).ConvertedValue

      gridObj.Records.Item(row_index).GetCellValue(field, true)



    Try exploring your grid in the Object Browser or creating some sample tests using the above calls to see whether this is what you need.

    You can also ask your tested application's developers or go through the xamDataGrid documentation for more info on the grid's native API.



    Good luck!
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Hi Peter,



    The grid control on your screenshot looks pretty much like Infragistics xamDataGrid (Infragistics.Windows.DataPresenter.XamDataGrid), which is supported in TestComplete 7.50 and later. TestComplete provides special properties and methods for supported grid controls, like ClickCell, wValue and others, which let you work with grid cells (see the attached screenshot). By the way, these methods and properties are recorded automatically when you record actions against supported grids.



    If your grid is customized and inherited from xamDataGrid, you can associate it with the base xamDataGrid to make the ClickCell and other special methods and properties available for it. To do this, add the grid's class name (the ClrFullClassName property value) to the Infragistics Controls | XamDataGrid category in your project's Object Mapping settings.



    Hope this helps!
  • nyczmagix's avatar
    nyczmagix
    Occasional Contributor

    Thanks Helen for that information. I was able to see the extended properties after enabling the derived property of the class.


    After doing this, however, another issue is seen as wValue property does not provide the actual value displayed on screen, but the underlying and unformatted data.


    e.g. A (100.00) displayed in a cell would come up as -100 in wValue. 


    Is there anyway to test what's the value in the cell?