I would use a DataTemplate with a DataType Date or DateTime (depending on how it will go through). Put a TextBlock in a DataTemplate with a StringFormat in a binding.
Something like this should work (unverified)
<DataTemplate DataType="{x:Type DateTime}"> <TextBlock Text="{Binding StringFormat={0:d}}" /> </DataTemplate>
Or, if you want it to be applied only to the grid
<wpfToolkit:DataGrid> <wpfToolkit:DataGrid.Resources> <DataTemplate DataType="{x:Type DateTime}"> <TextBlock Text="{Binding StringFormat={0:d}}" /> </DataTemplate> </wpfToolkit:DataGrid.Resources> ... </wpfToolkit:DataGrid>
Bryan Anderson May 11 '09 at 4:59 pm 2009-05-11 16:59
source share