C#, WPF ComboBox with two items inside
I have combo box which displays room numbers. Now i want to show room numbers and room types like this
102 Suite Double
305 Standard Single
and so on. I done this but problem is that i cannot get only room number. Can anyone advice me som开发者_开发技巧ething?
if you have two columns in the DataSource called: RoomNumberAndName
and RoomNumber
(id) you just need this:
<ComboBox Name="cbData" ItemsSource="{Binding DpData}"
DisplayMemberPath="RoomNumberAndName"
SelectedValuePath="RoomNumber" />
精彩评论