Forum Discussion
Hi Robert,
For your question..
It is not just the first time where it is taking a long time, every time I run the code it is taking time.
And for the threshold on the number of rows, I'm not sure on this.
#Scenario 1
I tried executing the find child method with number of rows as 4.
The method executed quickly (2-3 seconds)
#Scenario 2
I increased the number of rows to 40 and executed the same method.
This time it took longer time (10-15 seconds)
Also, I tried the same test on a different application but with the same grid (XTPReport). It is taking a long time in this case also.
Thanks!
-Rajesh
I suspect you already answered your own question.
"But when the number of children objects are less, it executes quickly."
Seems fairly logical. The more children there are, the longer it takes. You would expect that.
Although, it sounds like it's taking quite a long time (in computing terms) to find each one. 10+ seconds for only 40 rows isn't terribly quick.
It may be that the refresh (argument 4 in your FindChild call .... set to TRUE in your code) may be taking up some of that time. Have you tried doing a SYS.REFRESH instead and setting that argument to FALSE? See if it improves any?
You already have the depth set to 0 (argument 3) so it shouldn't be digging about in children of the rows (your screenshot of the object tree suggests all the rows have further children).