失败的原因找到了..太低级的错误了...




            DataGridViewComboBoxColumn combo = new DataGridViewComboBoxColumn();
            combo.Items.AddRange(new object[] { "包    ", "瓶    ", "盒    ", "带    ", "箱    " };
            combo.HeaderText = "单位";
            combo.DataPropertyName = "单位";
            dataGridView1.Columns.Add(combo);



问题就在combo.Items.AddRange(new object[] { "包    ", "瓶    ", "盒    ", "带    ", "箱    " });
以前用的是combo.Items.AddRange(new object[] """""""""" });
而库里面这个字段都带有空格所以 以前用的有错误...

太粗心了....
posted @ 2006-07-20 09:19  邵利超  阅读(629)  评论(0编辑  收藏  举报