大哥 我这样写还是不行么
private void Form1_Load(object sender, EventArgs e)
{
List<Person> list = new List<Person>();
list.Add(new Person() { Code = "100010", FirstName = "小东", LastName = "王" });
list.Add(new Person() { Code = "100009", FirstName = "小张", LastName = "2" });
list.Add(new Person() { Code = "100008", FirstName = "小刚", LastName = "3" });
list.Add(new Person() { Code = "100007", FirstName = "小刘", LastName = "4" });
FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType mcb = new FarPoint.Win.Spread.CellType.MultiColumnComboBoxCellType();
mcb.BackgroundImage = null;
mcb.DataSourceList = list;
mcb.DataColumn =1;
mcb.ColumnEdit =1;
//mcb.AcceptsArrowKeys = FarPoint.Win.SuperEdit.AcceptsArrowKeys.AllArrows;
mcb.ButtonAlign = FarPoint.Win.ButtonAlign.Right;
mcb.ListAlignment = FarPoint.Win.ListAlignment.Left;
mcb.ListWidth = 500;
mcb.ListOffset = 5;
mcb.MaxDrop = 5;
// mcb.StringTrim = StringTrimming.EllipsisCharacter;
mcb.Editable =true;
mcb.AutoSearch = mcb.AutoSearch = FarPoint.Win.AutoSearch.MultipleCharacter;
// fpSpread1.ActiveSheet.Columns[0].CellType = mcb;
fpSpread1.ActiveSheet.Columns[0].Editor = mcb;
}
private class Person
{
public string Code
{ get; set; }
public string FirstName
{ get; set; }
public string LastName
{ get; set; }
}
|