Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid and refresh problem
Message
From
27/05/2004 02:00:34
Dorin Vasilescu
ALL Trans Romania
Arad, Romania
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00907441
Message ID:
00907612
Views:
13
Hi
Try:
With ThisForm.Grid1
	.recordSource = ""
	.recordSource = "expence"
	.refresh()
	.setfocus()
EndWith
to avoid grid reconstruction.

I use this to assign a grid to a different table/alias as the one specified in design time and to keep out of going blank:
-set the tag of each column with the ControlSource, without alias part (only field name), in design time
-run this code after .RecordSource = ''
{Grid}.RecordSource = 'new_alias'
With {Grid}
	For i = 1 To .ColumnCount
		.Columns( i ).ControlSource = .Columns(i).Tag
	Endfor
	.Refresh()
Endwith
It is possible to encapsulate such functionality in the subclassed grid class used in applications, and all above code to be called by calling a grid custom method.
HTH

>I had a Refresh routine that refreshes the form, I added the following and all is fine.
>Thanks
>
>sele Table2 && expences
>With ThisForm.Grid1
> .recordSource = "expence"
> .refresh()
> .setfocus()
>EndWith
>sele Table1 && table for rest of form
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform