How can I get a DataGridTextColumn
to display a '-' (hyphen) instead of 0.
Here is how the data grid is currently setup:
<Grid>
<DataGrid x:Name="EmployeeHours"
AutoGenerateColumns="False"
ItemsSource="{Binding EmployeeHoursLastWeek}"
Width="Auto">
<DataGrid.Columns>
<DataGridTextColumn Header="PerceptionistID"
Binding="{Binding PerceptionistID}"
Width="100" />
<DataGridTextColumn Header="Week Of"
Binding="{Binding WeekOf, StringFormat={}{0:MM/dd/yyyy}}"
Width="75" />
<DataGridTextColumn Header="Regular Hours"
Binding="{Binding WorkHours}"
Width="100" />
<DataGridTextColumn Header="PTO Hours"
Binding="{Binding PTOHours}"
Width="100" />
<DataGridTextColumn Header="Holiday Hours"
Binding="{Binding HolidayHours}"
Width="100" />
</DataGrid.Columns>
</DataGrid>
</Grid>
PTOHours and HolidayHours are typically 0 and it would make it easier to identify cells with a value other than 0 if any cell with 0 displayed a '-' instead.