コンボボックスセルに値を入れる
データベースを使わなくとも可能
public void CreateCategoryCommbo(ComboBoxCell comboCell)//, DataTable dt, string displayMember, string dataField) { comboCell.Items.AddRange("Item2", "Item1", "Item3", "Item4", "Long Item to Make Ellipsis Show"); comboCell.DropDownStyle = MultiRowComboBoxStyle.DropDown; comboCell.FlatStyle = FlatStyle.Flat; } public void CreateHimokuCommbo(GcComboBoxCell comboHimokuCell, DataTable dt) { //コンボボックスの項目の元となるデーターベース comboHimokuCell.DataSource = dt; comboHimokuCell.AutoGenerateColumns = false; ListColumn lc1 = new ListColumn(); ListColumn lc2 = new ListColumn(); lc1.DataPropertyName = "himoku"; lc1.Width = 80; lc2.DataPropertyName = "category"; lc2.Width = 80; // lc2.Visible = false; comboHimokuCell.ListColumns.AddRange(new ListColumn[] { lc1, lc2 }); comboHimokuCell.DisplayText = "himoku"; comboHimokuCell.TextSubItemIndex = 1; comboHimokuCell.DataField = "himoku"; noby.Message(comboHimokuCell.DataMember.ToString());// = "himoku"; comboHimokuCell.AutoFilter.Enabled = true; comboHimokuCell.AutoFilter.MatchingMode = GrapeCity.Win.Editors.AutoCompleteMatchingMode.ExactMatchAll; comboHimokuCell.AutoFilter.MatchingSource = GrapeCity.Win.Editors.FilterMatchingSource.AllSubItems; comboHimokuCell.AutoCompleteMode = AutoCompleteMode.Append; comboHimokuCell.ListColumns[0].Header.Text = ""; comboHimokuCell.ListColumns[1].Header.Text = ""; comboHimokuCell.DropDownStyle = MultiRowComboBoxStyle.DropDown; comboHimokuCell.FlatStyle = FlatStyle.Flat; }