I have a custom control which is part of a list. The text that it should display is set by assigning a value to its Text property. At runtime, this text is loaded from a database. I want to prepend this text with the string ‘Toelichting: ‘ (Dutch for ‘Explanation’). I can accomplish this by setting the FormatString property of the control to the following:
'Toelichting: {0}'
Now, if the text that is loaded is an empty string, I want to display ‘Toelichting: –’, so with an en-dash at the end. Otherwise, I want to display ‘Toelichting: MyText’. Is it possible to add some condition-checking code to the FormatString, such that I can check if the parameter is not empty?
No, there’s no way to do that.