public void BindMultiColumnComboBox(MultiColumnComboBox combo) { bindedComboBox = combo; combo.SelectedIndexChanged += delegate(object sender, EventArgs args) { if (bindedComboBox.SelectedIndex != -1) { string val = bindedComboBox.SelectedKeyAsStr; if (ComboKey2Text != null) { val = ComboKey2Text(val); } this.Text = val; } }; this.Leave += (s, e) => SyncComboBoxItem(); }
public void CopyRows(MultiColumnComboBox src) { this.NumColumns = src.NumColumns; this.columnInfo = src.columnInfo; this.CaptionColumnNo = src.CaptionColumnNo; this.KeyColumnNo = src.KeyColumnNo; this.BeginUpdate(); this.ClearRows(); for (int i = 0; i < src.Items.Count; i++) { this.Items.Add(src.Rows(i)); } this.DropDownWidth = src.DropDownWidth; this.EndUpdate(); }