Exemplo n.º 1
0
        private void dataTableView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (this.dataTableView1.CurrentCell.ColumnIndex == this.col_MC.Index)
            {
                FindComboBoxEditingControl control = (e.Control as FindComboBoxEditingControl);
                control.SelectedIndexChanged -= new EventHandler(colRight_SelectedIndexChanged);
                control.SelectedIndexChanged += new EventHandler(colRight_SelectedIndexChanged);
            }


            DataGridViewCell currCell = this.dataTableView1.CurrentCell;

            if (currCell == null || currCell.ColumnIndex != this.col_MC.Index)
            {
                return;
            }
            TextBox textBoxExitingControl = e.Control as TextBox;

            if (textBoxExitingControl == null || textBoxExitingControl.IsDisposed)
            {
                return;
            }
            textBoxExitingControl.ImeMode   = ImeMode.Alpha;
            textBoxExitingControl.KeyPress -= new KeyPressEventHandler(this.TextBoxExitingControl_KeyPress);
            textBoxExitingControl.KeyPress += new KeyPressEventHandler(this.TextBoxExitingControl_KeyPress);
        }
Exemplo n.º 2
0
 private void dataTableView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
 {
     if (this.dataTableView1.CurrentCell.ColumnIndex == this.col_INCHARGE_DOCTOR.Index)
     {
         FindComboBoxEditingControl control = (e.Control as FindComboBoxEditingControl);
         control.SelectedIndexChanged -= new EventHandler(colRight_SelectedIndexChanged);
         control.SelectedIndexChanged += new EventHandler(colRight_SelectedIndexChanged);
     }
 }