I have a column that is bound to a property of my object. The property, LastRunDate, is a Datetime. On default/start, it displays a date along the lines of of 1/1/1 12:00 AM.
Is there a way in my XAML to format my date where if I have a date of this value, to instead show a string of "None" or even a blank? Is there a way I can put this into my string format?
Here's the XAML right now:
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding Name}" Header="Name" />
<DataGridTextColumn Binding="{Binding SourceServerName}" Header="Server Source" />
<DataGridTextColumn Binding="{Binding SourceDataBaseName}" Header="Database" />
<DataGridTextColumn Binding="{Binding LastRunTime, StringFormat={}\{0:MM/dd/yyyy hh:mm\}}" Header="Last Run Time" />
</DataGrid.Columns>
DateTime?does not work for you, I would recommend anIValueConverter