/// <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)
        {
            TextBox textBox = editingElement as TextBox;

            if (textBox != null)
            {
                DataGridHelper.UpdateSource(textBox, TextBox.TextProperty);
                return(!Validation.GetHasError(textBox));
            }

            return(true);
        }
示例#2
0
        /// <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);
        }
示例#3
0
        /// <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)
        {
            ComboBox comboBox = editingElement as ComboBox;

            if (comboBox != null)
            {
                DataGridHelper.UpdateSource(comboBox, ComboBox.SelectedValueProperty);
                DataGridHelper.UpdateSource(comboBox, ComboBox.SelectedItemProperty);
                DataGridHelper.UpdateSource(comboBox, ComboBox.TextProperty);
                return(!Validation.GetHasError(comboBox));
            }

            return(true);
        }