I have a DatePicker in a DataGrid:
<DataGridTemplateColumn Header="Next Date" Width="100" > <DataGridTemplateColumn.CellEditingTemplate> <DataTemplate> <DatePicker SelectedDate="{Binding NextDate, Mode=TwoWay, Converter={StaticResource dateConverter}}" /> </DataTemplate> </DataGridTemplateColumn.CellEditingTemplate> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <DatePicker Text="{Binding NextDate, Mode=TwoWay, Converter={StaticResource dateConverter}}" /> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn>
It is attached to an object that defines the NextDate property (NextDate is long, I use the converter to go between long and DateTime):
public long NextDate { get { return _nextDate; } set { if (_nextDate != value) { _nextDate = value; NotifyPropertyChanged("NextDate"); } } }
The problem is that when I change the date in the grid, either by typing or by selecting from the drop-down calendar, the NextDate property does not change. Any ideas?
Vadim source share