Page 1 of 1

YAGQ - Yet another Grid Question

Posted: Mon Jan 21, 2008 8:03 am
by homerjaysimpson
Hi folks,

I'm looking desperately for a solution for the following wxGrid problem: when I create a grid for let's say 1400 lines (via CreateGrid()), destroy it (via ClearGrid()) and then want to display another query set (for let's say 3200 entries), the Grid stops at 1400 lines. ClearGrid seems not to really wipe the lines. The Grid is not derived (so I have not derived a table either). Any suggestions ? Any help would be appreciated...

Re: YAGQ - Yet another Grid Question

Posted: Mon Jan 21, 2008 9:08 am
by tan
Hi,
homerjaysimpson wrote:Hi folks,

I'm looking desperately for a solution for the following wxGrid problem: when I create a grid for let's say 1400 lines (via CreateGrid()), destroy it (via ClearGrid()) and then want to display another query set (for let's say 3200 entries), the Grid stops at 1400 lines. ClearGrid seems not to really wipe the lines. The Grid is not derived (so I have not derived a table either). Any suggestions ? Any help would be appreciated...
try this to clear all rows:

Code: Select all

     grid->DeleteRows(0, grid->GetNumberRows());
And use BeginBatch()/EndBatch() to reduce screen flicker.

Posted: Mon Jan 21, 2008 1:19 pm
by homerjaysimpson
Thank you very much, now the rows are deleted correctly but when I then call CreateGrid() another time, no other row is added. What am I doing wrong here ?

Posted: Mon Jan 21, 2008 3:06 pm
by tan
homerjaysimpson wrote:Thank you very much, now the rows are deleted correctly but when I then call CreateGrid() another time, no other row is added. What am I doing wrong here ?
Well, why do you call CreateGrid() another time? You don't have to do it after DeleteRows(...), just add some others rows.

Posted: Mon Jan 21, 2008 5:20 pm
by timg
You don't want to call CreateGrid again.

Just call AppendRows(NumOfRows) on the grid you already have (after you delete the exisiting rows as suggested above)

Solved

Posted: Tue Jan 22, 2008 7:45 am
by homerjaysimpson
Thank you very much, that did the trick. So I can only call CreateGrid exactly one time then ? What's that for ?