Hi all,
I call GetCellProperty to get to get the text of the cell. It seems pretty slow and took 1 second (sometimes up to 10 sec) to run. My test makes many calls to it, so performance is pretty bad. Is there an alternative function to use to get the property of the cell? I've also tried GetNAProperty, that is even slower....
I was hoping to use the Column Name so I may avoid to iterate through the Column Indexes to find the Index....Thank you very much Dennis for your assistance :)
There are some instances when the Column Index is required, instead of the Column Name (and some instances when either one is allowed), so you'll have to pull the Column Index using QTP's .Net Windows Forms Spy (via the Tools menu).
Since I'm not sure how familiar you are with the .Net Windows Forms Spy, I'll tell you how I find the Column Index in our apps and hopefully it will apply to yours:
Once you've clicked on the grid and clicked OK on the Object Selection window, you go to Display Layout > Bands > {Name of Band} and click Columns. You then click the Elipse button to the right of [Collection] and the Index for each Column is displayed in the Members section.
I hope this helps!
Hi Dennis,
Thank you, this helps a lot. I changed my code to avoid using getcellproperty.
however, I run into problem with the following code
getValue=columnNameCollection.GetRowAtVisibleIndex(i).Cells.Item("Test Column").Text
I want to get the cell text, but it seems to require me to provide Column Index of the cell. I don't simply use the Column name to get the object. Have you encountered this before? thanks,
Based on the reply on 7-22-08, at 09:44 in this forum thread: http://forums.infragistics.com/forums/p/10809/41326.aspx, it appears you are using GetCellProperty correctly (although his example does have quotes around "iRowNumber").
If GetNAProperty isn't any faster, then the only other suggestion I can offer is drilling down into the grid similar to the methods you've already seen in the forum thread in your post of 9-21-09 at 12:18.
Another example of that can be found at the end of the thread in this forum: http://www.sqaforums.com/showflat.php?Number=537573&page=0
Otherwise, you may have to wait and see if one of the Infragistics crew has a solution. I'm sorry I haven't been able to provide more help!
The application that I test against has both scenarios. It appears that getcelldata would just get the value of the cell which happens to be the ID of the attribute in my case. I need to retrieve the text of the attribute.