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

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


            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 []  """""""""" } );
而库里面这个字段都带有空格所以 以前用的有错误...

太粗心了....

你可能感兴趣的:(错误)