Im using Listbox to present a table. It uses DisplayMemberPath to present items.
How can i do multi binding for displaying items?
Lets say i want to display ID and NAME ... is there a template example or such?
thnx
Use a DataTemplate.
<ListBox>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0}, {1}">
<Binding Path="ID" />
<Binding Path="Name" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With