0
我我的組合框綁定靜態的方式。選擇ComboBox項編程C#
當我設置字符串值這是我從項目對象(從服務方法)獲得,例如item.AssignmentType =「XYZ」我想使它可選擇的組合框。 我試過以下,但不工作
<ComboBoxItem Content="abc"/>
<ComboBoxItem Content="xyz"/>
<ComboBoxItem Content="pqrs"/>
string assignmenttype = item.AssignmentType.ToString();
AssignmentTypeCombobox.SelectedIndex =
AssignmentTypeCombobox.Items.IndexOf(assignmenttype);
請給我解決
[Combobox.SelectedItem](https://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.selecteditem(v = vs.110)。 ASPX) – bansi
試試看'AssignmentTypeCombobox.Text = 「XYZ」' – bansi
但是, 「文本」 屬性不UWP組合框 – Murali