I have a datagrid bound to an xml file in WPF. I can not figure out how to format the date that appears in my one of my DataTextColumns. I have tried converters and 'stringformat=d' and nothing seems to work. Any ideas?
The data in the 'Birthday' text column appears as 'dd/mm/yyyy hh:mm:ss AM/PM' because that is how it is stored in the xml file.
However I want it to display as 'dd/mm/yyyy'.
Here is my xaml. This is a simple binding and does not require any code behind.
<DataGrid Name="currentCrewGrid" DataContext="{StaticResource CrewInfo}" ItemsSource="{Binding XPath=/Names/Name[@isActive\=\'True\']}" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTextColumn IsReadOnly="True" Header="Birthday" Binding="{Binding XPath=Birthday}"/>
</DataGrid.Columns>
</DataGrid>