How to get Combobox.SelectedItem Return string value of what is selected instead of Service Reference Class?
- by Rohit Acharya
I currently have the following code for a button. The message box shows SilverlightApplication2.ServiceReference2.Employee instead of the text string selected by the user. The combobox items are being populated by a WCF service. As a result I am unable to pass it to the Async call. How do I get the string of what user selected?
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
object selectedItem = comobo1.SelectedItem.ToString();
MessageBox.Show(selectedItem.ToString());
var proxy = new Service1Client();
proxy.GetAllEmployeesCompleted += proxy_GetAllEmployeesCompleted;
proxy.GetAllEmployeesAsync(selectedItem.ToString());
}