Skip to content

Infragistics Community Forum / Test Automation For Micro Focus Uft Windows Forms / How to get the value of a cell from parent row of the swftable

How to get the value of a cell from parent row of the swftable

New Discussion
KIrtee Shende
KIrtee Shende asked on Mar 3, 2016 11:24 PM

we have a grid which has child objects. now we need to compare the parent row value with the child row values. I am able to fetch the child row column value. how to get the value of the parent row

Sign In to post a reply

Replies

  • 0
    Milko Venkov
    Milko Venkov answered on Feb 25, 2016 11:40 AM

    Hello KIrtee,

    Thank you for posting in our forum.

    If I understand you correctly you have a reference to the child row’s cell in your hierarchical grid. Now you need to get a reference to a particular cell in the parent row. You can achieve this with code like this:

    UltraGridCell parentRowCell = childCell.Row.ParentRow.Cells["[Parent Cell Name] or [Index]"];

    here childCell is the child cell you have a reference to.

    Please let me know if you need any additional information.

    Thank you for using Infragistics Controls.

    • 0
      KIrtee Shende
      KIrtee Shende answered on Feb 25, 2016 12:16 PM

      I am using UFT to identify the objects. could you help me with the code where I can use it. Can you help me in the proper syntax using GetNAProperty.

      • 0
        KIrtee Shende
        KIrtee Shende answered on Feb 25, 2016 12:17 PM

        or with GEtCellData method

      • 0
        Milko Venkov
        Milko Venkov answered on Feb 26, 2016 10:02 AM

        Hello KIrtee,

        Thank you for your feedback.

        I am not sure if I understand you correctly. How do you get the value of the child row’s cell? Can you send me the script which you are using? You may both use GetNAProperty and GetCellData. However for both methods you will need to know the row index and the column you need to get cell text for.

        Here is both methods syntax for your reference:

        cellData = SwfWindow("Form Name").SwfTable("Grid Name").GetCellData(rowIndex, collIndex)

        cellData = SwfWindow("Form Name").SwfTable("Grid Name").GetNAProperty("Rows[rowIndex].Cells[collIndex].Text")

        So please let me know how you get the child cell data and I will try to help you with getting the parent cell data.

        Looking forward to your reply.

        Thank you for using Infragistics Controls.

      • 0
        KIrtee Shende
        KIrtee Shende answered on Mar 3, 2016 10:59 AM

        this is the grid, I want the retrieve the value from the cell which is marked in orange?

        can anyone help me

      • 0
        Michael Germann
        Michael Germann answered on Mar 3, 2016 11:24 PM

        Hi Kirtee,  Well that depends, are you wanting to look at a specific Cell’s value. You can do that with the GetCellData method. This will return the value, the parameters you pass in are identical to that of SetCellData, but without the new value. This will work if you know which cell is orange, and just want to verify it. If you want to verify if a cell is orange you would need to use the GetCellAppearance method. Again the identification of the cell portion is identical to SetCellData, but it adds a Appearance enumeration property to identify what appearnace you want to return. Note how UFT works to return values from a method you need to put parenthesis around the parameters. So if your SetCellData was:SwfWindow(“Form1”).SwfTable(“ultraGrid1”).SetCellData “2”“Name”“Jim Bean” name = SwfWindow(“Form1”).SwfTable(“ultraGrid1”).GetCellData(“2”“Name”)

        similarly you can do :textColor = SwfWindow(“Form1”).SwfTable(“ultraGrid1”).GetCellAppearance(“2”“Name”, appForeColor)backColor = SwfWindow(“Form1”).SwfTable(“ultraGrid1”).GetCellAppearance(“2”“Name”, appBackColor)Hope this helps,

        Michael GermannSoftware Development Team LeadInfragistics

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
KIrtee Shende
Favorites
0
Replies
6
Created On
Mar 03, 2016
Last Post
9 years, 12 months ago

Suggested Discussions

Tags

No tags

Created by

Created on

Mar 3, 2016 11:24 PM

Last activity on

Feb 16, 2026 1:23 PM