RE: EuGrid question
- Posted by Jonas Temple <jtemple at yhti.net> Jul 21, 2003
- 430 views
Matt, As one who's used EuGrid fairly extensively, maybe I can help. The grid will be cleared if you call EGW_LoadData as: void = EGW_LoadData( grid, {{}}, EGW_REPLACE ) void = EGW_DeleteDataRow(grid, 1) and then call repaintWindow(grid) to refresh the grid control. I know this is cheesy, but the grid data is replaced by an empty row and then you delete the empty row you just added. FYI, Phil hasn't been around lately and both Tony Steward and myself have sent requests for bug fixes/enhancments and have not heard from him. Phil, if you read this and never got the requests, please let me know. Jonas Matt Lewis wrote: > > > I've started using EuGrid, and I want to be able to wipe out an entire > grid > (data and display). I'm displaying tables in a database, and the > fields, > size of the tables change, so it's easier to simply delete and restart > whenever I want to display another table. There doesn't seem to be a > good > way to do this. Here's what I've done: > > -- wiping out a grid: > cols = EGW_EnumCols( grid ) > for i = 1 to length(cols) do > void = EGW_DeleteCols( grid, cols[i] ) > end for > void = EGW_LoadData( grid, {}, EGW_REPLACE ) > > > The catch is, EGW_LoadData() doesn't like it when you send an empty > sequence, though this seems pretty obvious to me what should happen with > EGW_REPLACE, right? So, I added this elsif block to EGW_LoadData(): > > if grid > 0 and rows > 0 then > -- ... do lot's of stuff > > elsif grid > 0 and insert_position = EGW_REPLACE then > -- data = {}, so delete the whole thing... > GridData[grid] = data > GridFlag[grid] = data > GridCurrentCell[grid] = {-1,-1} > end if > > The only alternative to this seems to be to use EGW_DeleteDataRow(), > which > would be severely inefficient. Of course, now I have a non-standard > version > of EuGrid. :( > > Is there a better way? > > Matt Lewis > >