开发者

C#, WPF ComboBox with two items inside

开发者 https://www.devze.com 2023-04-02 22:23 出处:网络
I have combo box which displays room numbers. Now i want to show room numbers and room types like this

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" />
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号