Guest User

Untitled

a guest
Apr 23rd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. <DataGridTemplateColumn Header="Start Date">
  2. <DataGridTemplateColumn.CellTemplate>
  3. <DataTemplate>
  4. <DatePicker Name="StartDate" SelectedDate="{Binding StartDate}" BorderThickness="0" SelectedDateChanged="StartDate_SelectedDateChanged">
  5. <DatePicker.Resources>
  6. <Style TargetType="DatePickerTextBox">
  7. <Setter Property="IsReadOnly" Value="True"/>
  8. <Setter Property="IsEnabled" Value="False"/>
  9. </Style>
  10. </DatePicker.Resources>
  11. </DatePicker>
  12. </DataTemplate>
  13. </DataGridTemplateColumn.CellTemplate>
  14. </DataGridTemplateColumn>
  15.  
  16. Private Sub ValidateDateChanged(sender As Object, e As SelectionChangedEventArgs)
  17. If MessageBoxResult.No = MessageBox.Show("Yes to Continue with the change",
  18. vbApplicationModal + MsgBoxStyle.Information, MessageBoxButton.YesNo) Then
  19. how to reset the date value to the original value and stop event handler to not invoke again for this ovriden date change
  20. was trying this e.source.SelectedDate = CType(e.RemovedItems(0), Date)
  21. End If
  22. Sub
Add Comment
Please, Sign In to add comment