Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem with combo box in Windows form
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01175922
Message ID:
01175950
Views:
6
>I create a business object for invoices with 2 tables: Invoice (default) and InvoiceList. I also have a business object for stores. My form has a combo box for stores, which populates correctly. The combo box for invoices uses the table invoicelist as its binding source. It should have the invoices for all the stores at start up but it is not loading at all.

Let's tackle the problem of not loading invoices for all stores at startup. Try moving the code that retrieves stores and invoices AFTER the call to InitializeComponent. Before InitializeComponent() executes, none of your UI controls are instantiated, so you need to wait until after it executes to call methods that populate the controls.

public ViewInvoices()
{
//Get data for drop down lists
this.oStores = (Stores)this.RegisterBizObj(new Stores());
this.oInvoice = (Invoice)this.RegisterPrimaryBizObj(new Invoice());

InitializeComponent();

oStores.GetAllStores();
oInvoice.GetUniqueInvoices("*");
}

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform