I have a form with a grid and a combo box where a user can select the table name they wish to edit. I have the grid binding to the table name selected by calling Rebind() when the user makes a table name selection, and by handling the NeedDataSource event of the grid to bind to a DataTable. That seems to work fine.
The problem comes in when I try to edit. I added a GridEditCommandColumn to the MasterTableView's Columns collection so I get a link to start editing a row, and the editor form appears just fine. But when I click on 'update', and I try to handle the UpdateCommand event raised by the grid (from code cobbled together from forums), I get an argument out of range exception, that I believe is coming from the edited item's OwnerTableView.DataKeyValues collection which has zero elements.
One other thing to note, I am using Postgres as the database, but I don't think this is the issue, as I am using npgsql to get standard ado.net objects to bind to.