I have to access a property called "Hidden" for a column in UltraGrid. I can get this with the help of column Index but I want to access it with the column Key. Since Index is not reliable and it may change if the position of column is changed. This Hidden property is in UltraGrid->DisplayLayout->Bands->0 Band->Columns->Here provide Item Index ->Hidden
My code is
GridTable.DisplayLayout.Bands.getItem(0).Columns.getItem(5).Hidden.
I am able to get Hidden Property with the help of this line but the problem is if the column is moved to some other position on the grid, the Index of the column will be changed. Column Key is the fixed one that never changes. I cannot pass the column Key to getItem() method since it takes only Index. For Example, if the column Key is "Volume", How to get Hidden property with the help of the Key "Volume". Please provide me some kind of solution because this is very important for my scripting.
Thanks
Vidya
In this line, 5 is the Index of the column "Volume" and the Key for that Index 5 is again "Volume". Forgot to mention this in my previous post.
Thanks,
Using TestAdvantage of the matching version to NetAdvantage you have access to GetNAProperty. With that you can pass a key in the property string to get a value such as:
set Grid = SwfWindow("Form1").SwfTable("ultraGrid1")msgbox Grid.GetNAProperty("DisplayLayout.Bands[0].Columns[Volume].Hidden")
I hope this answers your question,
Hi,
I'm facing issues getting the values from an ultragrid.
There are 4 rows and when expanded i get another nested row within it....i need to get the values of these nested row items.
Can you help me out with that..?...i've tried all possible ways but not able to reach thr...
Regards,
Ravi Salunkhe
Hello Ravi,
For an UltraGrid with two levels, you would use a line of script similar to the following to get the value of the second cell in the first child row of the first row:
SwfWindow("Form1").SwfTable("ultraGrid1").GetCellData("0;0", "Column 1")
The GetCellData() method is actually built into QTP. Their documentation states the following about therowparameter for the GetCellData() method:
For Infragistics UltraWinGrid, specify the 0-based row number for top level bands. For child bands, specify the row with a string in the format:
"n1;n2;...nX"
where n is the row number in each band level.
I've created CAS-115526-T3R1R0 to handle this issue. Once we've come to a resolution, I will post it here.