设置 DataSource 属性后无法修改项集合

 

 

comboBox.DataSource = ds.Tables[0];
comboBox.DisplayMember = "Com_CompanyName";
comboBox.ValueMember = "Com_CompanyNo";
comboBox.Items.Insert(0, "--请选着—");

-------------------------------------------------------------------------------==

DataTable dt = ds.Tables[0];
DataRow dr = dt.NewRow();
dr["Com_CompanyName"] = "--选择所有--";
dt.Rows.InsertAt(dr, 0);

         comboBox.DataSource = ds.Tables[0];
         comboBox.DisplayMember = "Com_CompanyName";
         comboBox.ValueMember = "Com_CompanyNo";

posted @ 2009-09-02 17:44  汉城  阅读(1343)  评论(0编辑  收藏  举报