不知道你是否想实现自动匹配的功能,下面代码可以在输入的时候自动匹配,ComboBox的数据源可能和你设置的不太一样,你可以修改一下:
- FarPoint.Win.Spread.CellType.ComboBoxCellType combo = new FarPoint.Win.Spread.CellType.ComboBoxCellType();
- string[] cbstr;
- cbstr = new String[] { "AAA", "AABC", "ABBC","BBB","BBC","BCC" };
- string[] strval;
- strval = new String[] { "1", "2", "3", "4", "5", "6" };
-
- combo.Items = cbstr;
- combo.ItemData = strval;
- combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;
- combo.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
- combo.AutoCompleteSource = AutoCompleteSource.ListItems;
- combo.Editable = true;
- fpSpread1.Sheets[0].Cells[0, 0].CellType = combo;
复制代码 |