码迷,mamicode.com
首页 > 其他好文 > 详细

ComboBox绑定

时间:2015-01-13 21:21:41      阅读:103      评论:0      收藏:0      [点我收藏+]

标签:


this.ComboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
this.ComboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
this.ComboBox1.DropDownWidth = 400;
this.ComboBox1.DropDownHeight = 400;
string sql = " sql语句 ";
DataTable dt = LinQBaseDao.Query(sql).Tables[0];
DataRow dr = dt.NewRow();
dr["Contract_No"] = "0";
dr["Contract_Name"] = "";
dt.Rows.InsertAt(dr, 0);
ComboBox1.DataSource = dt;
ComboBox1.ValueMember = "Contract_No";
ComboBox1.DisplayMember = "Contract_Name";

ComboBox绑定

标签:

原文地址:http://www.cnblogs.com/yangdunqin/p/4222321.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!