Exemple #1
0
 /// <summary>
 /// Small utility function that updates the local dirty state and
 /// notifies the grid of the value change.
 /// </summary>
 private void NotifyDataGridViewOfValueChange()
 {
     if (EditingControlValueChanged)
     {
         EditingControlDataGridView.NotifyCurrentCellDirty(true);
     }
 }
Exemple #2
0
 ///<summary>
 /// Сигнализирует об изменении выбора в элементе управления
 ///</summary>
 protected override void InvokeSelectedIndexChanged()
 {
     // have changed.
     _valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     base.InvokeSelectedIndexChanged();
 }
Exemple #3
0
    // /// <summary>
    // ///   Changes the control's user interface (UI) to be consistent with the specified
    // ///   cell style.
    // /// </summary>
    // /// <param name="dataGridViewCellStyle">
    // ///   The System.Windows.Forms.DataGridViewCellStyle to use as the model for the
    // ///   UI.
    // /// </param>
    // public override void ApplyCellStyleToEditingControl(
    //   DataGridViewCellStyle dataGridViewCellStyle) {
    //   base.ApplyCellStyleToEditingControl(dataGridViewCellStyle);
    //   Font = dataGridViewCellStyle.Font;
    //   ForeColor = dataGridViewCellStyle.ForeColor;
    //   BackColor = dataGridViewCellStyle.BackColor;
    // }

    // /// <summary>
    // ///   Gets or sets the System.Windows.Forms.DataGridView that contains the cell.
    // /// </summary>
    // public DataGridView EditingControlDataGridView { get; set; }
    //
    // /// <summary>
    // ///   Gets or sets the formatted value of the cell being modified by the editor.
    // /// </summary>
    // public object EditingControlFormattedValue {
    //   get => Text;
    //   set => Text = value.ToString();
    // }
    //
    // /// <summary>
    // ///   Gets or sets the index of the hosting cell's parent row.
    // /// </summary>
    // public int EditingControlRowIndex { get; set; }
    //
    // /// <summary>
    // ///   Gets or sets a value indicating whether the value of the editing control
    // ///   differs from the value of the hosting cell.
    // /// </summary>
    // public bool EditingControlValueChanged { get; set; }
    //
    // /// <summary>
    // ///   Determines whether the specified key is a regular input key that the editing
    // ///   control should process or a special key that the System.Windows.Forms.DataGridView
    // ///   should process.
    // /// </summary>
    // /// <param name="key">
    // ///   A System.Windows.Forms.Keys that represents the key that was pressed.
    // /// </param>
    // /// <param name="dataGridViewWantsInputKey">
    // ///   True when the System.Windows.Forms.DataGridView wants to process the System.Windows.Forms.Keys
    // ///   in keyData; otherwise, False.
    // /// </param>
    // /// <returns>
    // ///   True if the specified key is a regular input key that should be handled by
    // ///   the editing control; otherwise, False.
    // /// </returns>
    // public bool EditingControlWantsInputKey(
    //   Keys key,
    //   bool dataGridViewWantsInputKey) {
    //   // Let the ComboBox handle the keys listed.
    //   switch (key & Keys.KeyCode) {
    //     case Keys.Left:
    //     case Keys.Up:
    //     case Keys.Down:
    //     case Keys.Right:
    //     case Keys.Home:
    //     case Keys.End:
    //     case Keys.PageDown:
    //     case Keys.PageUp:
    //       return true;
    //     default:
    //       return !dataGridViewWantsInputKey;
    //   }
    // }
    //
    // /// <summary>
    // ///   Gets the cursor used when the mouse pointer is over the
    // ///   System.Windows.Forms.DataGridView.EditingPanel
    // ///   but not over the editing control.
    // /// </summary>
    // public Cursor EditingPanelCursor => base.Cursor;
    //
    // /// <summary>
    // ///   Retrieves the formatted value of the cell.
    // /// </summary>
    // /// <param name="context">
    // ///   A bitwise combination of System.Windows.Forms.DataGridViewDataErrorContexts
    // ///   values that specifies the context in which the data is needed.
    // /// </param>
    // /// <returns>
    // ///   An System.Object that represents the formatted version of the cell contents.
    // /// </returns>
    // public object GetEditingControlFormattedValue(
    //   DataGridViewDataErrorContexts context) {
    //   return EditingControlFormattedValue;
    // }
    //
    // /// <summary>
    // ///   Prepares the currently selected cell for editing.
    // /// </summary>
    // /// <param name="selectAll">
    // ///   True to select all of the cell's content; otherwise, False.
    // /// </param>
    // /// <remarks>
    // ///   No preparation needs to be done.
    // /// </remarks>
    // public void PrepareEditingControlForEdit(bool selectAll) { }
    //
    // /// <summary>
    // ///   Gets or sets a value indicating whether the cell contents need to be repositioned
    // ///   whenever the value changes.
    // /// </summary>
    // public bool RepositionEditingControlOnValueChange => false;

    protected override void OnSelectedIndexChanged(EventArgs e) {
      // Notify the DataGridView that the contents of the cell
      // have changed.
      // EditingControlDataGridView.CurrentCell.Value = SelectedValue; 
      EditingControlDataGridView.NotifyCurrentCellDirty(true);
      base.OnSelectedIndexChanged(e);
    }
Exemple #4
0
 protected override void OnValueChanged(EventArgs eventargs)
 {
     // Notify the DataGridView that the contents of the cell have changed.
     _valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     base.OnValueChanged(eventargs);
 }
        //値が変更された時
        protected override void OnTextChanged(EventArgs e)
        {
            base.OnTextChanged(e);

            EditingControlValueChanged = true;

            if (EditingControlDataGridView != null)
            {
                try
                {
                    if (Text == null)
                    {
                        EditingControlDataGridView.CurrentCell.Value = "";
                    }
                    else
                    {
                        EditingControlDataGridView.CurrentCell.Value = Text;
                    }
                }
                catch
                {
                }
                EditingControlDataGridView.NotifyCurrentCellDirty(true);
            }
        }
        protected override void OnTextChanged(EventArgs e)
        {
            base.OnTextChanged(e);

            _valueChanged = true;
            EditingControlDataGridView.NotifyCurrentCellDirty(true);
        }
        protected override void OnTextChanged(EventArgs e)
        {
            if (inPrepare)
            {
                return;
            }
            base.OnTextChanged(e);

            bool changed = !(EditingControlDataGridView.CurrentCell.Value as string == base.Text ||
                             (String.IsNullOrEmpty(base.Text) && String.IsNullOrEmpty(EditingControlDataGridView.CurrentCell.Value as string)));

            if ((base.SelectionLength == 0 || base.SelectionStart == base.Text.Length) && isDeleting == false)
            {
                if (base.Items.Contains(base.Text) == false)
                {
                    for (int n = 0; n < base.Items.Count; n++)
                    {
                        if (((string)base.Items[n]).StartsWith(base.Text, StringComparison.OrdinalIgnoreCase) == true)
                        {
                            int start = base.SelectionStart;
                            inPrepare = true;

                            base.Text            = base.Items[n] as string;
                            base.SelectionStart  = start;
                            base.SelectionLength = base.Text.Length - start;

                            inPrepare = false;
                            break;
                        }
                    }
                }
            }
            EditingControlValueChanged = changed;
            EditingControlDataGridView.NotifyCurrentCellDirty(changed);
        }
Exemple #8
0
 private void SComponent_ValueChanged(object sender, EventArgs e)
 {
     // Notify the DataGridView that the contents of the cell
     // have changed.
     valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
 }
Exemple #9
0
 protected new void OnValueChanged(EventArgs eventargs)
 {
     // Notify the DataGridView that the contents of the cell
     // have changed.
     _valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     _tagList.OnValueChanged(eventargs);
 }
Exemple #10
0
 private void NotifyDataGridViewOfValueChange()
 {
     this.valueChanged = true;
     if (EditingControlDataGridView != null)
     {
         EditingControlDataGridView.NotifyCurrentCellDirty(true);
     }
 }
 protected override void OnLeave(EventArgs e)
 {
     base.OnLeave(e);
     if (EditingControlDataGridView.IsCurrentCellInEditMode)
     {
         EditingControlValueChanged = true;
         this.EditingControlDataGridView.NotifyCurrentCellDirty(true);
         EditingControlDataGridView.EndEdit();
     }
 }
 protected override void OnTextChanged(EventArgs e)
 {
     if (Field.SourceMode != SourceMode.None)
     {
         UpdateSearchBox();
     }
     valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     base.OnTextChanged(e);
 }
Exemple #13
0
 //-------------------------------------------------------------------
 void m_control_ValueChanged(object sender, EventArgs e)
 {
     m_bValueChanged = true;
     if (EditingControlDataGridView != null)
     {
         EditingControlDataGridView.NotifyCurrentCellDirty(true);
     }
     if (ChangementValeur != null)
     {
         ChangementValeur(this, new EventArgs());
     }
 }
Exemple #14
0
 //-----------------------------------------------------------------------------
 private void CControlEditionDataPlanning_KeyPress(object sender, KeyPressEventArgs e)
 {
     try
     {
         SendKeys.Send(e.KeyChar + "");
         if (EditingControlDataGridView != null)
         {
             EditingControlDataGridView.NotifyCurrentCellDirty(true);
         }
         m_bValueChanged = true;
     }
     catch
     { }
 }
Exemple #15
0
        void ColorEditingControl_Click(object sender, EventArgs e)
        {
            ColorDialog diag = new ColorDialog();

            diag.Color = Value;
            if (diag.ShowDialog() == DialogResult.OK)
            {
                if (Value != diag.Color)
                {
                    valueChanged = true;
                    EditingControlDataGridView.NotifyCurrentCellDirty(true);
                    Value = diag.Color;
                }
            }
        }
Exemple #16
0
 private void CCtrlEditSelonType_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (ControlEdition != null)
     {
         ControlEdition.Focus();
     }
     try
     {
         SendKeys.Send(e.KeyChar + "");
         if (EditingControlDataGridView != null)
         {
             EditingControlDataGridView.NotifyCurrentCellDirty(true);
         }
         m_bValueChanged = true;
     }
     catch
     { }
 }
        private void maskedTextBox_TextChanged(object sender, EventArgs e)
        {
            if (EditingControlDataGridView != null)
            {
                EditingControlDataGridView.NotifyCurrentCellDirty(true);
            }
            EditingControlValueChanged = true;

            if (!DebtDAO.GetSettings().IsAutoPasteClassifier)
            {
                return;
            }
            //автоподстановка классификатора
            int    position = (int)caretField.GetValue(maskedTextBox) + 1;
            string code     = Classifier.RemoveMaskSymbols(Text.Substring(0, position));

            if (string.IsNullOrEmpty(code) || code.Length == Classifier.CodeLenght)
            {
                return;
            }

            var    clsf    = DebtDAO.FindNearestClassifier(code);
            string newCode = null;

            if (clsf != null)
            {
                newCode = clsf.MaskedCode;
            }
            else
            {
                newCode = code + new string('0', Classifier.CodeLenght).Substring(0, Classifier.CodeLenght);
            }
            position -= 1;
            Text      = newCode;
            if (0 <= position && position < maskedTextBox.MaskedTextProvider.Length)
            {
                caretField.SetValue(maskedTextBox, position);
            }
        }
Exemple #18
0
 void CalendarControl_SelectDay(object sender)
 {
     EditingControlDataGridView.EndEdit();
 }
 /// <summary>
 /// Raises the <see cref="Control.TextChanged"/> event.
 /// </summary>
 /// <param name="e">An <see cref="EventArgs"/> that contains the event data.</param>
 private void Control_TextChanged(object sender, EventArgs e)
 {
     EditingControlValueChanged = true;
     EditingControlDataGridView?.NotifyCurrentCellDirty(true);
 }
Exemple #20
0
 protected override void OnNewEditValue()
 {
     _valueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     base.OnNewEditValue();
 }
 protected override void OnVoteResultChanged()
 {
     EditingControlValueChanged = true;
     EditingControlDataGridView?.NotifyCurrentCellDirty(true);
     base.OnVoteResultChanged();
 }
Exemple #22
0
 protected override void OnValueChanged(EventArgs eventargs)
 {
     EditingControlValueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
     base.OnValueChanged(eventargs);
 }
Exemple #23
0
 private void ExtendedComboBoxControl_SelectedValueChanged(object sender, EventArgs e)
 {
     EditingControlValueChanged = true;
     EditingControlDataGridView.NotifyCurrentCellDirty(true);
 }