Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prevent griddata flash on change recordsource 1

Status
Not open for further replies.

DirkVFP

Programmer
Aug 25, 2005
57
NL
Hello all,

How can I prevent the flashing of my griddata when I change its recordsource? The recordsource is a cursor which is filled from a select statement (RecoursourceType = Alias).

In my program the user is working with orders per day, so whenever a user selects a different day than the current one, I need to refill the cursor so it will contain the correct information.

First I let the grid recordsource use a dummy grid (so the layout will be safe), second I'm filling the cursor with the appropriate information and last I'm reassinging the cursor to the grid's recordsource. This results in a flash which I really want to prevent.
 
3 ways:
1.
Code:
thosform.LockScreen = .t.
*** reassign Grid RecordSource
*** Grid Refresh
thosform.LockScreen = .f.

2. Do not change recordSource, there where yuo need to change data:
Code:
thisform.LockScreen = .t.
SELECT ... INTO CURSOR crsTest && Get right data to different cursor

SELECT GridRecordSource
ZAP
APPEND FROM (DBF("crsTest"))
USE IN crsTest
thisform.LockScreen = .f.

3. Use Parametrised View or CursorAdapter as a RecordSource of the Grid. Then just Requery or CursorRefresh()


Borislav Borissov
 
Thanks Borislav, I will try out the ways you provided.

Since I'm using a treeview on my form which' content is also changed per day (and it flashes too) I tried the LockScreen property and that didn't stop the flashing.

So I'm now trying the two other ways.
 
No ActiveX controls didn't affect thisform.LockScreen.
Try:

Code:
DECLARE INTEGER LockWindowUpdate IN Win32API INTEGER nHandle 
LockWindowUpdate(_VFP.hWnd)
*** Do something here
LockWindowUpdate(0)
CLEAR DLLS LockWindowUpdate

Borislav Borissov
 
Thanks, that works perfect!
Do you perhaps have a link to a website with more handy Windows functions like these which I'm unaware (or SHOULD be aware) of?

(Sometimes I wish I had a co-worker just like you around Borislav, but alas that is not the situation ;-) )
 
Excellent site which I directly added on top of my favorites.
Thanks again for your help.

I will report on what solution proved best to me regarding the flashing problem of the grid.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top