Hi,
I have a DataGridView and a BindingNavigator bound to the same BindingSource (which is in its turn bound to a DataTable from a typed DataSet).
DataGridView.AllowUserToAddRow = True, so the New Row is visible.
I've noticed that clicking the BindingNavigator.AddNewItem button does not select the New Row. In stead, it creates a new record at the end of the DGV, just before the New Row.
Is this default behaviour, or does it behave like this because of something in my code?
(Sorry if this is explained somewhere else and I missed it. Seems like a straightforward scenario to me, but I couldn't find any explanation.)
Because of this behaviour, calculating and setting default values for the new row isn't as straightforward as it seems anymore.
If I set DataGridView.AllowUsersToAddRow = False, I can still add new rows with the BindingNavigator.AddNewItem button. But I cannot set default values through the AddingNewEventArgs.NewObject because my data source is a DataTable (explained in Help for the AddingNewEventArgs class).
With DataGridView.AllowUsersToAddRow = True, I can set the new row's cells using the DataGridView.DefaultValuesNeeded event, but it does not get fired when the user clicks the AddNewItem button.
Any suggestions?
Tnx,
flip.be