forlano Messages: 1207 Registered: March 2006 Location: Italy
Senior Contributor
Hello,
I have a GridCtrl populated by many data. Each time I feed a record at the end of the ctrl I would like to visualize it.
I tried
grid.GoEnd()
but the lelection go on the last row but no autoscroll is performed and the row remains not visible.
Even grid.ShowRow(lastrow) does not work.
Which is the magic method that let appear the last added row at the end of the grid?
unodgs Messages: 1367 Registered: November 2005 Location: Poland
Ultimate Contributor
forlano wrote on Sat, 21 January 2012 13:19
Hello,
I have a GridCtrl populated by many data. Each time I feed a record at the end of the ctrl I would like to visualize it.
I tried
grid.GoEnd()
but the lelection go on the last row but no autoscroll is performed and the row remains not visible.
Even grid.ShowRow(lastrow) does not work.
Which is the magic method that let appear the last added row at the end of the grid?
Thanks,
Luigi
That's strange. GoEnd is supposed to scroll the content of the grid. I'll check what's going on.
forlano Messages: 1207 Registered: March 2006 Location: Italy
Senior Contributor
unodgs wrote on Sat, 28 January 2012 20:13
Sorry for not responding.. I checked this and "it works on my computer" Could you please give me simplest possible test case? Thank you in advance.
Thank you, I'll try to prepare asap the test case (a grid with more data than that it can show at once).
Just now I have noticed that instead grid.GoBegin() works. Moreover, grid.GoEnd() called just after grid.GoBegin() works!
Perhaps it is matter of some initialized parameter. I am using TDM-GCC and U++ 4295.
unodgs Messages: 1367 Registered: November 2005 Location: Poland
Ultimate Contributor
Ok, now I see what the problem is. You're going end before application window is open. The grid was optimized to recalculate everything only when it's absolutely needed and only if the grid is visible. That however causes few problems including that one you ran into. But I think that GoEnd (and family) should work in every context - so it's fixed now. I'll commit the changes when I get back home. And you were right about some uninitialized variable - it was part of the problem.
I think grid needs rewriting (too many interferences in the code) but I'm reluctant to do it (developing current version took me few years . But I guess this day is coming
forlano Messages: 1207 Registered: March 2006 Location: Italy
Senior Contributor
unodgs wrote on Mon, 30 January 2012 12:02
Ok, now I see what the problem is. You're going end before application window is open. The grid was optimized to recalculate everything only when it's absolutely needed and only if the grid is visible. That however causes few problems including that one you ran into. But I think that GoEnd (and family) should work in every context - so it's fixed now. I'll commit the changes when I get back home. And you were right about some uninitialized variable - it was part of the problem.
I think grid needs rewriting (too many interferences in the code) but I'm reluctant to do it (developing current version took me few years . But I guess this day is coming
The problem in my app was present even when the window was already openend.
Thanks a lot.
Luigi
forlano Messages: 1207 Registered: March 2006 Location: Italy
Senior Contributor
unodgs wrote on Wed, 15 February 2012 13:38
Yes - still have problems?
Hi Daniel,
with new version, 4603 and tdd-gcc, the test case works, but my program refuse to work .
But if I use
tab1.arr.GoBegin();
tab1.arr.GoEnd();
then GoEnd() works
It seems there is something in GoBegin that set properly a variable that is necessary for GoEnd to work properly. Unfortunatly I cannot see this in the source code.