I have a master-detail form on which I have a datagridview(detail) that is bound to a table. Within that grid one of the columns displays values from another table using a combobox. Under normal circumstances this all works quite well. However, if you go to the new record at the bottom of the grid and click the down arrow of the combobox the autonumber field populates as it should and the master key value is also automatically entered as it should be. The problem is that if the user decides not to select a value from the list and they try to delete the line they get an error message (Current item cannot be removed from the list because there is no current item.).
I tried to disable the delete button of the bindingnavigator when the form starts if the bindingsource count is not > 0 which works, but as soon as the user begins to edit the new record of the grid it is enabled again.
I have also tried taking the on_click event of the navigator delete button, but it resumes afterwards.
I may have to create a record if the user does not do so and the let the bindingnavigator delelte that record. It just seems like a sloppy way of doing things.
I would appreciate any other suggestions.
Thanks,
Michael
I tried to disable the delete button of the bindingnavigator when the form starts if the bindingsource count is not > 0 which works, but as soon as the user begins to edit the new record of the grid it is enabled again.
I have also tried taking the on_click event of the navigator delete button, but it resumes afterwards.
I may have to create a record if the user does not do so and the let the bindingnavigator delelte that record. It just seems like a sloppy way of doing things.
I would appreciate any other suggestions.
Thanks,
Michael