General information
Category:
The Mere Mortals .NET Framework
Title:
Again a mmCombobox question
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only