depmar

depmar

  • NA
  • 1
  • 0

inserting new record

Apr 5 2004 8:31 AM
I create a simple form with Data Form Wizard than I add a DataGrid. I have a readonly bound DataGrid and some Read/Write bound text boxes (text boxes were generated by Data Form Wizard). I want the DataGrid only to enable record selection and to give the user an overview. Problem: When I add a row using BindingContext.AddNew and then click somewhere else in the DataGrid, I get a message box telling me the record is invalid ("Column 'CategoryName' does not allow nulls. " and if I want to correct the error. This message alone is not too bad, however the focus is set to the grid. Whenever the user tries to set the focus to one of the text boxes, the Message reappears! How can I stop this message and get an event about an invalid record instead?