Have a Question?
Print

00877: GRID cells seem to loose data, or Grid doesn’t seem to scroll correctly through all the data

Title:

GRID cells seem to loose data, or Grid doesn’t seem to scroll correctly through all the data

Description:

Grids do not cache all the data you put into the Grid, but in fact the grid drops data all the time. All grid programs have to check for notify event 22, which is the grid saying it needs to refresh data. This sample from grid tutorial 1 shows data being refreshed after event 22: 

When the main grid or the row heading grid needs to refresh one or more cells and doesn’t have the data cached, it sends Notify event number 22. When this message is received, code should be executed to redraw the specified cell(s). The values returned in the templated NOTICE$ string control which cells are redrawn. Draw Cell – SENDMSG() Function 54 uses the grid information block to transfer data to the control: 

if event.id=grid and event.code$=”N” and event.flags=22 
: then 
: for row=notice.toprow to notice.botrow; 
: grid.row%=row; 
: for col=notice.leftcol to notice.rightcol; 
: grid.col%=col; 
: grid.textcolor$=$000000$, grid.backcolor$=$ffffff$ 
: grid.style%=0 
: byte=row*16+col; 
: grid.buf$=chr(byte); 
: result$=sendmsg(sysgui,grid,54,0,grid$); 
: next col; 
: next row 
if event.id=rowid and event.code$=”N” and event.flags=22 

: then 
: for row=notice.toprow to notice.botrow 
: row_head_grid.row=row; 
: row_head_grid.textcolor$=$000000$, row_head_grid.backcolor$=$ffffff0$ 
: grid.style%=2 
: row_head_grid.buf$=hta(chr(row*16)); 
: tf$=sendmsg(sysgui,rowid,54,0,row_head_grid$) 
: next row 


Use this information form the ‘GRID TUTORIAL 1 ‘ and you will have success. 



Last Modified: 11/28/2000 Product: Visual PRO/5 Operating System: Windows

BASIS structures five components of their technology into the BBx Generations.

Table of Contents
Scroll to Top