WPF: How to bind object to ComboBox

后端 未结 3 1379
清歌不尽
清歌不尽 2020-12-13 02:13

Trying to learn how to bind objects to various types of controls. In this instance, I want to get sample data in my object to appear in ComboBox. The code runs but what appe

3条回答
  •  情歌与酒
    2020-12-13 02:34

    Trying to get selected value from combobox returns System.Data.Entity.DynamicProxies.x

     private void Button_Click(object sender, RoutedEventArgs e){
             string _scanner0 = int.Parse(mycmb.SelectedValue.ToString());
             string _scanner1 = mycbr.SelectedItem.ToString();
             string _scanner2 = mycbr.SelectedValuePath.ToString();
             string _scanner3 = mycbr.text.ToString();
         }
    

    all these Returns System.Data.Entity.DynamicProxies.x What should i do?

提交回复
热议问题