Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PROBLEM: impossible to use lookup relations on grid
Message
From
18/09/2003 11:04:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
17/09/2003 12:24:49
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00829957
Message ID:
00830321
Views:
18
>Hi,
>
>i use a relation for lookup text values on a cursor and put text on a grid.
>
>Elements:
>- a big cursor CA with id key ( SPT downloaded on async mode )
>- a local cursor CB with text description of id key, and a index on id key
>- a two column grid for display CA.id and CB.text
>
>- this grid is on a top form;
>- on top form exists many child forms with other data grids.
>
>For fast display of the master grid, i uses a relation
>"CA.id into CB.id_index".
>
>But, if i move,resize... or do other operation that fire a paint() on top form, and when paint() occur, the active cursor is not CA, the relation
>is not applied, and values on Text column is fixed to the current value of
>CB.text field.
>
>I put a simplied repro code ( this is only for show the problem ):
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>	Top = 0
>	Left = 0
>	Height = 292
>	Width = 477
>	DoCreate = .T.
>	Caption = "Form1"
>	Name = "Form1"
>
>	ADD OBJECT grid1 AS grid WITH ;
>		ColumnCount = 2, ;
>		Height = 200, ;
>		Left = 11, ;
>		RecordSource = "CA", ;
>		Top = 10, ;
>		Width = 259, ;
>		Name = "Grid1", ;
>		Column1.ControlSource = "CA.id", ;
>		Column1.Name = "Column1", ;
>		Column2.ControlSource = "CB.Txt", ;
>		Column2.Name = "Column2"
>
>	PROCEDURE Resize
>		this.grid1.height=this.Height-10
>	
>	PROCEDURE Load
>		CREATE CURSOR CA (id I DEFAULT RECNO())
>		FOR n=1 TO 50
>			APPEND BLANK
>		ENDFOR
>		GO TOP
>		CREATE CURSOR CB (k_id I DEFAULT RECNO(),Txt C(20) DEFAULT STR(k_id))
>		FOR n=1 TO 50
>			APPEND BLANK
>		ENDFOR
>		INDEX ON k_id TAG PK
>		*SET FILTER TO SEEK(id,'CB') IN CA
>		SET RELATION TO id INTO CB IN CA
>	ENDPROC
>
>
>	PROCEDURE Click
>		CREATE CURSOR CC (id I)
>		APPEND BLANK
>	ENDPROC
>
>ENDDEFINE
>
>
>1. run this
>2. click on form
>3. resize form, or mousescroll on grid.
>4. now you click on grid cells ( relations is not applied )
>
>The problem is that Paint() on Top form fire also when a operation is done on a form child, a than is hard to found a workaroud.
>
>Fabio
*..
		SET RELATION TO id INTO CB IN CA  
Select CA
*...
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform