1

I have a simple DataGrid with its ItemSource bound to an

ObservableCollection<Issue>
where Issue is just a class object containing various properties. I have a handful of DataGridTextColumn items bound to the properties of the Issue object and all works as expected.
Binding="{Binding Path=DueDate, StringFormat=dd-MMM-yyyy}" Header="Due Date"

Now, I want to set the color of the Foreground depending upon if that date has passed so you would expect that you can do this:

Foreground="{Binding Path=DueDate, Converter={StaticResource DateHasPastColorConverter}}" 

where

DateHasPastColorConverter

returns one of two colors depending upon if the date being past has past.

My problem is that I can access the Issue.DueDate property in the main column binding but it is not available for the Foreground or any other property. The only properties available are those from the actual view model itself.

How do I access the properties of the row to to this and why are they not available? It's like only the binding member recognises the Issue properties and all other bdinginds only recognise the view models properties.

Chris
  • 41
  • 6

0 Answers0