Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grids without a data source
Message
From
22/03/2004 08:55:38
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
22/03/2004 08:47:11
Paul Trimming
Lonely Pilgrim Shareware
Merstham, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00888489
Message ID:
00888490
Views:
15
>I am a new foxpro programmer working with a grid.
>
>I want to use a grid without a data source to collect information, and then, if it stacks up, save some of it to a table.
>
>However, when I run my grid, it seems to be read-only, that is, I can't enter anything in it. Is this normal for grids without record-source or control-source? If so, what is the normal way of collecting non-databound info???
>
>Thanks,
>Trimtrom

Paul,
Grids are never w/o a recordsource, IOW they're always data bound.
If you'd collect non-databound info use other controls instead.
If however the data you'd collect could be represented in columns, create a cursor and set it as a recordsource for grid. Insert one empty record initially and set AllowAddNew to .t.
ie: Would collect 2 char type and 1 integer type data :
Public oForm
oForm = Createobject('myForm')
oForm.Show

Define Class myForm As Form
  Datasession = 2
  Add Object myGrid As Grid With AllowAddNew = .T.

  Procedure Load
  Create Cursor myCollector (f1 c(10),f2 c(10), f3 i)
  Append Blank
Endproc
Enddefine
As you should have noticed though we don't specify a recordsource, grid 'snaps' to alias it finds.
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
Next
Reply
Map
View

Click here to load this message in the networking platform