예제 #1
0
        private void Data1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            TextBox autoText = e.Control as TextBox;

            autoText.AutoCompleteMode   = AutoCompleteMode.Suggest;
            autoText.AutoCompleteSource = AutoCompleteSource.CustomSource;
            if (Data1.CurrentCell.ColumnIndex == 0)
            {
                if (autoText != null)
                {
                    autoText.AutoCompleteCustomSource = ClsPublic.CargatAutoCompleteCodigo();
                }
            }
            else if (Data1.CurrentCell.ColumnIndex == 1)
            {
                if (autoText != null)
                {
                    autoText.AutoCompleteCustomSource = ClsPublic.CargatAutoCompleteCuenta();
                }
            }
            else
            {
                autoText.AutoCompleteCustomSource = null;
            }
        }