Exemple #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="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 position, object p_StartEditValue)
        {
            base.InternalStartEdit(p_Cell, position, p_StartEditValue);

            if (EnableEdit == false)
            {
                return;
            }

            TextBoxTypedButton l_Combo = GetEditorTextBoxTypedButton(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 = 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(position);
                l_Combo.SelectAllTextBox();
            }
        }
Exemple #2
0
        public override Control CreateEditorControl()
        {
            TextBoxTypedButton l_ComboBox = new TextBoxTypedButton();

            l_ComboBox.TextBox.BorderStyle = BorderStyle.None;
            return(l_ComboBox);
        }