Пример #1
0
        void importGridView_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            if (importGridView.CurrentCell == null || importGridView.CurrentCell.ColumnIndex != columnTitle.Index)
            {
                return;
            }

            currentComboBox = e.Control as ComboBox;
            if (currentComboBox != null)
            {
                currentComboBox.SelectedIndexChanged += comboBoxChangedHandler;
                currentComboBox.Tag = importGridView.Rows[importGridView.CurrentCell.RowIndex].DataBoundItem;
                int maxWidth = Emulators2Settings.GetComboBoxDropDownWidth(currentComboBox);
                columnTitle.DropDownWidth = maxWidth > columnTitle.Width ? maxWidth : columnTitle.Width;
            }
        }
Пример #2
0
        void resultsComboBox_DropDown(object sender, EventArgs e)
        {
            int maxWidth = Emulators2Settings.GetComboBoxDropDownWidth(resultsComboBox);

            resultsComboBox.DropDownWidth = maxWidth > resultsComboBox.Width ? maxWidth : resultsComboBox.Width;
        }