参考:Format values in a Datagrid
参考:Remove stringFormat while editing cell in datagrid
使用 DataGridTemplateColumn 实现:
<DataGridTemplateColumn Header="Coût (k€)"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Text="{Binding Path=TechnicalCostAmount, Mode=OneWay, StringFormat=N0, ConverterCulture=fr-FR}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <TextBox Text="{Binding Path=TechnicalCostAmount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> </DataTemplate> </DataGridTemplateColumn.CellEditingTemplate> </DataGridTemplateColumn>