Exemplo n.º 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.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 = 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();
            }
        }
Exemplo n.º 2
0
        private void TemplatesEditor_DialogOpen(object sender, EventArgs e)
        {
            SourceLibrary.Windows.Forms.TextBoxTypedButton txtBtn = (SourceLibrary.Windows.Forms.TextBoxTypedButton)sender;
            OpenFileDialog dlg = new OpenFileDialog();

            if (txtBtn.Value is String)
            {
                dlg.FileName = (string)txtBtn.Value;
            }
            dlg.Filter = "Xml Files|*.xml|All Files|*.*";
            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                txtBtn.Value = dlg.FileName;
            }
        }
Exemplo n.º 3
0
 public override Control CreateEditorControl()
 {
     SourceLibrary.Windows.Forms.TextBoxTypedButton l_ComboBox = new SourceLibrary.Windows.Forms.TextBoxTypedButton();
     l_ComboBox.TextBox.BorderStyle = BorderStyle.None;
     return(l_ComboBox);
 }