I have a collection of objects that I wish to bind to a ListView control. In some of the objects, the value of a property that will be displayed in a column in the ListView is an empty string (“”). I want to replace the empty string (“”) with “n/a” automatically using binding.
How can I accomplish this?
Define a value converter:
Example XAML:
You may even parameterize the converter and expose the “N/A” in XAML: