Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bug: reload a Grid not set Highlight selected row
Message
From
17/05/2004 12:05:21
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Bug: reload a Grid not set Highlight selected row
Miscellaneous
Thread ID:
00904601
Message ID:
00904601
Views:
59
If you load a form with
- a empty or preset RecordSource Grid
- and with
HighlightStyle = 2
The selected record is Highlighted correctly.

But, if you reload the RecordSource programmatically,
the selected record is not Highlighted.

For Highlight the row do a Grid::Refresh or set the focus into the grid.

Repro:
* Run            -> Highlighted correctly
* Press Reload   -> not Highlighted
* Press Refresh  -> Highlighted correctly
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form

	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"

	ADD OBJECT Reload AS commandbutton WITH ;
		Top = 2, ;
		Left = 12, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Reload"

	ADD OBJECT Refresh1 AS commandbutton WITH ;
		Top = 1, ;
		Left = 102, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Refresh"

	ADD OBJECT grid1 AS grid WITH ;
		Height = 200, ;
		Left = 11, ;
		Top = 33, ;
		Width = 349, ;
		HighlightStyle = 2, ;
		Name = "Grid1"

	PROCEDURE Load
		CREATE CURSOR CA (id I DEFAULT RECNO(),fname C(100) DEFAULT REPLICATE(CHR(RAND()*255),rand()*100))
		FOR n=1 TO 100
			APPEND BLANK
		ENDFOR
		GO 5
	ENDPROC

	PROCEDURE Reload.Click
		thisform.Grid1.RecordSource = 'CA'
	ENDPROC

	PROCEDURE Refresh1.Click
		thisform.Grid1.Refresh
	ENDPROC

ENDDEFINE
For Large and Complex grid with dynamicXXXX this require two refresh cycle,
with a 50% slow down performance, LockScreen is not usefull here.
Next
Reply
Map
View

Click here to load this message in the networking platform