/// <summary> /// Called when a cell's value is to be cancelled, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <param name="uneditedValue">UneditedValue</param> protected override void CancelCellEdit(FrameworkElement editingElement, object uneditedValue) { TextBox textBox = editingElement as TextBox; if (textBox != null) { DataGridHelper.UpdateTarget(textBox, TextBox.TextProperty); } }
/// <summary> /// Called when a cell's value is to be cancelled, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <param name="uneditedValue">UneditedValue</param> protected override void CancelCellEdit(FrameworkElement editingElement, object uneditedValue) { CheckBox checkBox = editingElement as CheckBox; if (checkBox != null) { DataGridHelper.UpdateTarget(checkBox, CheckBox.IsCheckedProperty); } }
/// <summary> /// Called when a cell's value is to be cancelled, just before it exits edit mode. /// </summary> /// <param name="editingElement">A reference to element returned by GenerateEditingElement.</param> /// <param name="uneditedValue">UneditedValue</param> protected override void CancelCellEdit(FrameworkElement editingElement, object uneditedValue) { ComboBox comboBox = editingElement as ComboBox; if (comboBox != null) { DataGridHelper.UpdateTarget(comboBox, ComboBox.SelectedValueProperty); DataGridHelper.UpdateTarget(comboBox, ComboBox.SelectedItemProperty); DataGridHelper.UpdateTarget(comboBox, ComboBox.TextProperty); } }