1

I have added item in the ComboBox.I am not able to retrieve the selected item if I Select some Item in the combobox.

Most of the combox Propertise return Object Type and if If I try to do ToString() on the object it return Weird Value.

I tried these Propertise.

 MainPage::cmbDeviceList_SelectionChanged(Platform::Object^ sender,      Windows::UI::Xaml::Controls::SelectionChangedEventArgs^ e){
 auto str = cmbDeviceList->SelectedItem->ToString;
 auto str1 = cmbDeviceList->SelectedValue->ToString();
 }    

My Query is

  1. How to Retrieve the items from the combobox On user selection
  2. Why Most of the properties return Object.Is the purpose of keeping Object is to allow developer to insert class struct?

1 Answer 1

0

Finally I got Answer.

It should be

 auto str = (String^) cmbDeviceList->SelectedItem;

But Still Not clear Why it is like that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.