For editing a row, you don't need to do anything. The user can just click in the grid and start editing (assuming the grid is not read-only).
For adding a row, you can do [tt]APPEND BLANK IN <view's work area>[/tt] in the button's Click event. The new row will then be available for editing. (You might need to set focus to the grid to make the row visible.)
To save the edits, do [tt]TABLEUPDATE()[/tt] in the Click event of the Save button. You should also have a Cancel button which has [tt]TABLEREVERT()[/tt] in the Click event.
Now having said all that, I have to say that editing data in a grid makes for a poor user interface. It is better to use the grid for navigating the data rather than directly editing it. A better approach is to let the user double-click on the row they wish to edit; that would open a modal form which contains all the data-entry fields for the view; when they save and close the form, the view gets updated.
Alternatively, place the data-entry fields on the same form as the grid. As the user navigates the grid, refresh the data-entry fields so that they always show the data for the current row. Let the user edit those fields, rather than the grid. You would still need Save and Cancel buttons, as above.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads