Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Again a mmCombobox question
Message
From
21/08/2003 12:31:17
Ali Ihsan Turkoolu
Galaksi Bilgisayar A.Þ.
Ankara, Turkey
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
Again a mmCombobox question
Miscellaneous
Thread ID:
00822250
Message ID:
00822250
Views:
35
Hi,

On the "Order System CSharp" example CustomerOrders form, List tab page,
I wanted to select CustomerID from a combobox, instead of entering manually.

I have added Customer business object. It has a method as:

public DataSet GetAllCustidAndCompanyName()
{
return (this.GetDataSet("SELECT CustomerID, CompanyName FROM Customers"));
}

I put a mmCombobox control to form.

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?

Thanks,
Ali Ihsan
Next
Reply
Map
View

Click here to load this message in the networking platform