/// <summary> /// Called when a cell's value is to be committed, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <returns>false if there is a validation error. true otherwise.</returns> protected override bool CommitCellEdit(FrameworkElement editingElement) { CheckBox checkBox = editingElement as CheckBox; if (checkBox != null) { DataGridHelper.UpdateSource(checkBox, CheckBox.IsCheckedProperty); return(!Validation.GetHasError(checkBox)); } return(true); }
/// <summary> /// Called when a cell's value is to be committed, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <returns>false if there is a validation error. true otherwise.</returns> protected override bool CommitCellEdit(FrameworkElement editingElement) { DatePicker textBox = editingElement as DatePicker; if (textBox != null) { DataGridHelper.UpdateSource(textBox, DatePicker.TextProperty); return(!Validation.GetHasError(textBox)); } return(true); }
/// <summary> /// Called when a cell's value is to be committed, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <returns>false if there is a validation error. true otherwise.</returns> protected override bool CommitCellEdit(FrameworkElement editingElement) { PactComboBox textBox = editingElement as PactComboBox; if (textBox != null) { DataGridHelper.UpdateSource(textBox, PactComboBox.TextProperty); DataGridHelper.UpdateSource(textBox, PactComboBox.SelectedValueProperty); return(!Validation.GetHasError(textBox)); } return(true); }