Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
RightClick() not responding
Message
From
24/02/2003 14:26:27
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
24/02/2003 14:01:28
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00755234
Message ID:
00757132
Views:
14
>Hi Dragan,
>
>Thanks for tip, but unfortunately after zap and appending of the new record, the grid is empty. I tried refreshing the form and the grid itself and that doesn't work. Is there something else I have to do in order to see the new set of data. TIA

Here's my code:
Select (This.calias)
Zap
If Used(This.ctempcur) And Reccount(This.ctempcur)>0
	Append From Dbf(This.ctempcur)
	Locate
Endif
This.cTempCur is the alias of the temporary (SQL-selected) cursor which holds the new data. Maybe you're missing the locate statement, or you still have some .recordsource= somewhere. When using this technique, you should not touch the recordsource at all, and the code to build the grid should run only once, best in grid's init. There you do something like this (I have my column class defined in dcGrids.prg and it basically adds my textbox (or other) class and sets the .currentcontrol):
Local lcCursor
lcCursor="curpptsearch"
Create Cursor (lcCursor) (pptpk i, ippttype i, cppttype c(2), cname c(80))
This.RecordSource=lcCursor
this.ColumnCount=0
Set Procedure To dcgrids Additive
This.AddObject("colCType","gcol","Typ",lcCursor+".cppttype")
this.colctype.visible=.t.
This.AddObject("colcName","gcol","Name",lcCursor+".cname")
this.colcname.visible=.t.
Works for me.
Another good trick is that while you're doing some mumbo jumbo inside a grid, you should set the focus to some object outside the grid, or else a few automatic behaviors kick in, like the grid's attempt to keep you on the same visible row (which is a mess if you're switching the grid order and want to stay on the same record), and set focus back to grid when you're done.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform