Beispiel #1
0
        /// <summary>
        /// Start editing the cell passed. Do not call this method for start editing a cell, you must use Cell.StartEdit.
        /// </summary>
        /// <param name="p_Cell">Cell to start edit</param>
        /// <param name="p_Position">Editing position(Row/Col)</param>
        /// <param name="p_StartEditValue">Can be null(in this case use the p_cell.Value</param>
        public override void InternalStartEdit(Cells.ICellVirtual p_Cell, Position p_Position, object p_StartEditValue)
        {
            base.InternalStartEdit(p_Cell, p_Position, p_StartEditValue);

            if (EnableEdit == false)
            {
                return;
            }

            SourceLibrary.Windows.Forms.ComboBoxTyped l_Combo = GetEditorComboBox(p_Cell.Grid);
            l_Combo.Validator              = this;
            l_Combo.EnableEscapeKeyUndo    = false;
            l_Combo.EnableEnterKeyValidate = false;
            l_Combo.EnableLastValidValue   = false;
            l_Combo.EnableAutoValidation   = false;

            if (p_StartEditValue is string && IsStringConversionSupported())
            {
                l_Combo.TextBox.Text = SourceLibrary.Windows.Forms.TextBoxTyped.ValidateCharactersString((string)p_StartEditValue, l_Combo.TextBox.ValidCharacters, l_Combo.TextBox.InvalidCharacters);
                if (l_Combo.TextBox.Text != null)
                {
                    l_Combo.TextBox.SelectionStart = l_Combo.TextBox.Text.Length;
                }
                else
                {
                    l_Combo.TextBox.SelectionStart = 0;
                }
            }
            else
            {
                l_Combo.Value = p_Cell.GetValue(p_Position);
                l_Combo.SelectAllTextBox();
            }
        }
Beispiel #2
0
 public override Control CreateEditorControl()
 {
     SourceLibrary.Windows.Forms.ComboBoxTyped l_ComboBox = new SourceLibrary.Windows.Forms.ComboBoxTyped();
     l_ComboBox.TextBox.BorderStyle = BorderStyle.None;
     return(l_ComboBox);
 }