Rip,
>Because EditItemIndex is somehow going from a non-negative number to -1 between the SaveDataSet Call and the mmDataGrid.BindBack method this line:
That's puzzling...there's really no code in the SaveDataSet that would affect the value of the data grid's SelectedIndex value.
When SaveDataSet is called, the business object raises a PreSaving event. Any UI controls registered as event handlers for the business object respond to this event and bind back their current values.
Is it possible a different DataGrid than you think is responding to this event? One whose EditItemIndex is -1? Check in the debugger to be sure.
If not, I recommend stepping through the code to see where the index seems to be changing.
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com