>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