WPF组合框值和显示文本 [英] WPF combobox value and display text
本文介绍了WPF组合框值和显示文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我习惯做
State.Items.Add(new ListItem { Text = "SomeState", Value = NumericIDofState });
状态是ASP.NET中的列表框.
Where State is a Listbox in ASP.NET.
我如何使用WPF ComboBox达到相同的目的?我确实在ComboBoxItem对象中看到一个名为内容"的属性,但是如何为每个项目分配一个与显示给用户的值不同的值?请帮忙.
How do i achieve the same with a WPF ComboBox? I do see a property called 'Content' in the ComboBoxItem object but how do i assign each item a value other than what's displayed to the user? Please help.
推荐答案
查看组合的这些属性: