예제 #1
0
            /// <summary>
            /// TODO: Documentation InitializeEditingControl
            /// </summary>
            /// <param name="rowIndex"></param>
            /// <param name="initialFormattedValue"></param>
            /// <param name="dataGridViewCellStyle"></param>
            public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
            {
                base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);

                DataGridViewCheckBoxComboBoxControl control = this.DataGridView.EditingControl as DataGridViewCheckBoxComboBoxControl;
                DataGridViewCheckBoxComboBoxColumn  config  = this.OwningColumn as DataGridViewCheckBoxComboBoxColumn;

                control.DisplayMemberSingleItem = config.DisplayMemberSingleItem;
                control.TextSeparator           = config.TextSeparator;

                foreach (CheckBoxComboBoxItem item in control.CheckBoxItems)
                {
                    item.Checked = false;
                }

                if (this.Value != Convert.DBNull)
                {
                    Dictionary <String, Object> values = this.Value as Dictionary <String, Object>;

                    foreach (String key in values.Keys)
                    {
                        control.CheckBoxItems[key].Checked = true;
                    }
                }

                control.BeginInvoke(new MethodInvoker(control.ShowDropDown));
            }
예제 #2
0
            /// <summary>
            /// TODO: Documentation DetachEditingControl
            /// </summary>
            public override void DetachEditingControl()
            {
                DataGridViewCheckBoxComboBoxControl control = this.DataGridView.EditingControl as DataGridViewCheckBoxComboBoxControl;

                control.BeginInvoke(new MethodInvoker(control.HideDropDown));

                base.DetachEditingControl();
            }