Habanero.Faces.Win.EditableGridWin.CheckIfComboBoxShouldSetToEditMode C# (CSharp) Method

CheckIfComboBoxShouldSetToEditMode() public method

Checks whether this is a comboboxcolumn and whether it should begin edit immediately (to circumvent the pain of having to click a cell multiple times to edit the value). This method is typically called by the cell click handler.
This method was extracted from the handler in order to make testing possible, since calling BeginEdit at testing time causes an STA thread error.
public CheckIfComboBoxShouldSetToEditMode ( int columnIndex, int rowIndex ) : bool
columnIndex int
rowIndex int
return bool
        public bool CheckIfComboBoxShouldSetToEditMode(int columnIndex, int rowIndex)
        {
            if (columnIndex > -1 && rowIndex > -1 && !CurrentCell.IsInEditMode && this.ComboBoxClickOnce)
            {
                var dataGridViewColumn =
                    ((DataGridViewColumnWin) Columns[columnIndex]).DataGridViewColumn;
                if (dataGridViewColumn is DataGridViewComboBoxColumn)
                {
                    return true;
                }
            }
            return false;
        }
    }