![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? |
#3
| |||
| |||
|
|
On Fri, 2 Nov 2007 02:16:30 -0400, "news.microsoft.com" billgower (AT) charter (DOT) net> wrote: I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Add a CustomerId Property to Invoice that returns Customer.CustomerId. |
#4
| |||
| |||
|
|
So for every field in customer that I need to access and in other classes that are composites I need to set properties up in Invoice? Bill "Jack Jackson" <jacknospam (AT) pebbleridge (DOT) com> wrote in message news:npbmi39kj7uiso93qj0ob7ougb803b11ok (AT) 4ax (DOT) com... On Fri, 2 Nov 2007 02:16:30 -0400, "news.microsoft.com" billgower (AT) charter (DOT) net> wrote: I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Add a CustomerId Property to Invoice that returns Customer.CustomerId. |
#5
| |||
| |||
|
|
On Fri, 2 Nov 2007 02:16:30 -0400, "news.microsoft.com" billgower (AT) charter (DOT) net> wrote: I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Add a CustomerId Property to Invoice that returns Customer.CustomerId. |
#6
| |||
| |||
|
|
I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm,I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Bill |
#7
| |||
| |||
|
|
I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Bill |
#8
| |||
| |||
|
|
So can this be done only in code or can it be done in the designer property window for the target object? Bill "Morten Wennevik [C# MVP]" <MortenWennevik (AT) hotmail (DOT) com> wrote in message news p.t095rhzwdj93y5 (AT) ubuan (DOT) ..Hi Bill, Just refer to the property like you would in code. Invoice invoice = new Invoice(); BindingSource source = new BindingSource(invoice, ""); // Bind to the CustomerName property of the CustomerName object in the Invoice object textBox1.DataBindings.Add("Text", source, "Customer.CustomerName"); On Fri, 02 Nov 2007 07:16:30 +0100, news.microsoft.com billgower (AT) charter (DOT) net> wrote: I have an object called Invoice which has as one of its members, an object called customer which is of type Customer. Class Customer has properties such as CustomerId, CustomerName, etc. In my form, InvoiceDetailForm, I bind the controls on the form to a binding source InvoiceBS which is tied to the Invoice object. How do I bind a control on the form to Invoice.Customer.CustomerId using the designer? Bill |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |