找回密码
 立即注册

QQ登录

只需一步,快速开始

lypvc

银牌会员

17

主题

44

帖子

2515

积分

银牌会员

积分
2515

活字格认证

lypvc
银牌会员   /  发表于:2013-7-25 15:44  /   查看:4770  /  回复:3
我把ComboBoxCellType 做为一个组合框来使用,怎么做,
把value与text分开绑定,并显示。
为combo指定...
datasource,
DataTextField
DataValueField

3 个回复

倒序浏览
iceman
社区贡献组   /  发表于:2013-7-25 17:33:00
沙发
回复 1楼lypvc的帖子

lypvc 你好,
参考代码如下:

  1. FarPoint.Win.Spread.CellType.ComboBoxCellType combo = new FarPoint.Win.Spread.CellType.ComboBoxCellType();

  2. private void Form1_Load(object sender, System.EventArgs e)
  3. {        
  4.       string[] cbstr;
  5.       cbstr = new String[] {"One", "Two", "Three"};
  6.       string[] strval;
  7.       strval = new String[] {"1", "2", "3"};
  8.       combo.Items = cbstr;
  9.       combo.ItemData = strval;
  10.       combo.EditorValue = FarPoint.Win.Spread.CellType.EditorValue.ItemData;
  11.       fpSpread1.Sheets[0].Cells[0, 0].CellType = combo;
  12. }

复制代码
回复 使用道具 举报
lypvc
银牌会员   /  发表于:2013-7-25 18:38:00
板凳
回复 2楼iceman的帖子

十分感谢,问题解决。
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2013-7-26 08:56:00
地板
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部