Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Again a mmCombobox question
Message
 
À
21/08/2003 12:31:17
Ali Ihsan Turkoolu
Galaksi Bilgisayar A.Þ.
Ankara, Turquie
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Divers
Thread ID:
00822250
Message ID:
00822384
Vues:
15
Ali,

>I assigned :
> BindingSource : Customer
> BindingSourceDisplayMember : CompanyName
> BindingSourceValueMember : CustomerID
>
>I filled the below event:
>
>private void cboCustomers_SelectedIndexChanged(object sender, System.EventArgs e)
> {
> int nIndex = this.cboCustomers.SelectedIndex;
> this.txtCustomerID.Text = this.oCustomer.GetCurrentDataSet().Tables[0].Rows[nIndex][0].ToString();
> }
>
>System is working. The question is:
>
>Is there easer way to get selected CustomerId?

Since the CustomerID is already stored in the combo box, it's easier to get the selected value from the combo box's SelectedValue property:
private void cboCustomers_SelectedIndexChanged(object sender, System.EventArgs e)
{
    this.txtCustomerID.Text = this.cboCustomers.SelectedValue;
}
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