Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with combo box in Windows form
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Versions des environnements
Environment:
C# 2.0
OS:
Windows Server 2003
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01175922
Message ID:
01175950
Vues:
7
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform