What is your question, or is that meant as a tip? Tek Tips posting asks for a thread type first. Please pick the lightbulb icon (helpful tip),,, if you don't want to ask a question, which is the default thread type, or pick news or review.
All I can say to what you describe is that a record object surely is one way to get a single record into an object, but on the other side a grid does not have a recordsourcetype that is for a record object, in fact a grid is a multiple records displaying control by nature of it and no matter what record number you point to, a grid shows the table, the active record will be highlighted and will be in the visible lines the grid displays, but neither a SEEK nor a SCATTER NAME will cause a grid to only display that one record, neither the first nor a second grid. To limit a grid to only show one record your options are mainly: 1. Select only one record into a separate result Cursor
2. Set FILTER so only the one record you want to show in the grid is fulfilling that filter, for example SET FILTER TO id=idof the found record or SET FILTER TO RECNO()= some record number. obviously SET FILTER TO RECNO()=RECNO() won't work, so you have to store RECNO() into a variable and then can SET FILTER TO RECNO()=variable, for example. It's easy to see why, imagine the filter is tested for every record, not just the current record, so while RECNO() is the number of the current record SET FILTER TO RECNO()=RECNO() will (virtually) visit all records and check the condition for it, which always is .t., not only for one record. The only way to only filter for one RECNO() is to first tore it into a variable as that variable will not change while all records are visited, whereas RECNO() does change when scanning all records.
Just for sake of completeness a FILTER will not actually cause visiting all records, in fact after you SET FILTER directly you also have to issue LOCATE so the filter causes the workarea to place its record pointer on the first record fulfilling the filter criterion. It will be the first record, if your condition is RECNO()=RECNO(), of course, because 1=1. It is the grid control, specifically, which will continues to display further rows and siplay them until the grid is full, but the grid only does so for it's display, it does not change the current record. Still SET FILTER TO RECNO()=RECNO() will effectively be like no filter at all for any purposes, be it SCAN, LOCATE, CONTINUE, BROWSE or showing the workarea in a grid.
Sorry if I hammer on the RECNO()=RECNO() condition, I am aware you didn't mention it, I don't assume you did this, it was just to illustrate the working of a filter and grid in conjunction.
Perhaps a simpler description of what the grid does is have a secondary look on the workaera you make the grid recordsource to fill the visible rows portion of the grid, without affecting the record pinter in the workare itself. But respecting the SET FILTER condition which actually is bound to only the original workarea. I don't know the behind the scenes implementation of the grid in C++, but it's easy to see that both BROWSE and the grid show more than one record, while still having the active row concept, both browse and grid have the active record indicator, unless you set grid.recordmark=.f., but that only hides that mark, the workarea nd grid still have the active row, addressing alias.fieldname gives you the value of that current rows field, because obviously there is no schrödinger field that is a superposition of the values of all records.
Taken it from the other side, granted you have a record object you create by SCATTER NAME, the grid is not the control to display this record object, there is no mode of a grid or other list based controls like combobox or listbox to display a record object, what you can do is add multiple single textboxes as cells and set their controlsources to each individual recordobjectnmae.fieldname property. In other words you 8use variable based data binding as controlsource. But this kind of binding is only available in controls are single value oriented, like textbox, editbox, checkbos (only special boolean types, though), or spinner ( for numeric fields only). There is no control that displays all properties of an object and displays all object properties. The listbox has a very specific rowsourcetype for arrays and collections, the latter being the VFP "collection" base class or subclasses you make, but a scatter object is neither an array nor a collection. All in all, there are some more very strange and also rarely used rowsourcetypes or recordsourcetypes, but blame me if there is one for single objects I overlook, you mainly use controls for either single fields or lists of records not for this in between thing of a single record with multiple properties that were created from the fields of the source workarea scattered.
Chriss