PC Review


Reply
Thread Tools Rate Thread

AddingNew BindingSource

 
 
=?Utf-8?B?R2lvdmFubmk=?=
Guest
Posts: n/a
 
      23rd Nov 2005
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?


Regards,

Giovanni
 
Reply With Quote
 
 
 
 
Luxspes [MCP]
Guest
Posts: n/a
 
      24th Nov 2005
Have you tried setting
the default value using:
http://msdn.microsoft.com/library/de...valuetopic.asp



Giovanni wrote:
> 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?
>
>
> Regards,
>
> Giovanni

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bindingsource addingnew Rick Microsoft ADO .NET 5 16th Apr 2007 06:09 AM
BindingSource AddingNew method with DataSets Flomo Togba Kwele Microsoft ADO .NET 3 17th Feb 2007 06:24 AM
RE: Clarifying Usage of AddingNew with BindingSource Linda Liu [MSFT] Microsoft Dot NET Framework Forms 0 8th Dec 2006 08:09 AM
RE: Clarifying Usage of AddingNew with BindingSource Linda Liu [MSFT] Microsoft Dot NET Framework Forms 2 8th Dec 2006 04:36 AM
Re: Clarifying Usage of AddingNew with BindingSource Bart Mermuys Microsoft Dot NET Framework Forms 0 7th Dec 2006 11:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:03 AM.