AddingNew BindingSource



Hi All,

Need help with the following:

I have a DataGridView bound to an SQL Server table. I would like to
use the ocrresponding Windows Forms BindingSource's AddingNew event to
default a column to a specified value. For example, when the user clicks on
an "Add New Customer" button or the "New" button on the BindingNavigator
control, I'd like to use the AddingNew event of the BindingSource to default
certain values like CustomerID, Quantity, etc... to a value that I assign
programatically (value may come from another object or table). The problem
is that I have read that I cannot use the AddingNew event of the
BindingSource when the source is bound to a table.

In the AddingNew event of the BindingSource, I am using typed Datasets
and would like to create a new "Customer" row, modify some properties (ID,
Quanity, AddingNewEventArgs. That's where the error occurs. Any help?



Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question