I’ve got an application, which uses many listBoxes with data attached to them using listBox.ItemsSource. The problem is it creates entries like [namespace].[class_name].
How can I create a template, which will replace entries with, eg. class “Name” field?
I look forward to hear from you soon,
MattheW
[namespace].[classname] is the default implementation of the
ToStringmethod, which is called if you don’t specify what to display.You can use the
DisplayMemberPathproperty to specify which member of the class you want to display :If you want more control on how the items are displayed, you can define a
DataTemplatefor your data type and assign it to theItemTemplateproperty of theListBox