Parent/Child databinding to datagridview and using 'esc' key causes error

Parent/Child databinding to datagridview and using 'esc' key causes error

Old forum URL: forums.lhotka.net/forums/t/501.aspx


odie posted on Wednesday, June 28, 2006

I have a form with two datagridview controls, one binds to Shifts and the other to ShiftDetails. When the user selects a shift from the parent list I set the datasource to the corresponding ShiftDetails for that selection.

The problem I am having is when you enter a couple of values and then press the ESC key to delete the current record while in add mode I am getting the following error

'Current cell cannot be set to an invisible cell'

If I ignore the error the ShiftDetailID cell and ShiftID cell on the parent form become visible, though they should not.

How do I prevent the datagridview control from trying to select the cell index 0, my hidden recordID cell, when the ESC key is pressed.

 

Copyright (c) Marimer LLC