Exemplo n.º 1
0
        protected override void OnClick(DataGridViewCellEventArgs e)
        {
            LookupDropDownEditingControl dropdown = (DataGridView.EditingControl as LookupDropDownEditingControl);

            if (dropdown != null)
            {
                dropdown.ShowDropDown();
            }
            base.OnClick(e);
        }
Exemplo n.º 2
0
        public override void InitializeEditingControl(int rowIndex, object
                                                      initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
        {
            // Set the value of the editing control to the current cell value.
            base.InitializeEditingControl(rowIndex, initialFormattedValue,
                                          dataGridViewCellStyle);



            LookupDropDownEditingControl ctl =
                DataGridView.EditingControl as LookupDropDownEditingControl;

            ctl.DataSource    = ((LookupDropDownColumn)this.OwningColumn).LookupControl.DataSource;
            ctl.DisplayMember = ((LookupDropDownColumn)this.OwningColumn).LookupControl.DisplayMember;
            ctl.DropDownWidth = ((LookupDropDownColumn)this.OwningColumn).LookupControl.DropDownWidth;
            ctl.EditValue     = this.Value;
        }