我将一个List<string>对象绑定到BindingSource,然后将这个BindingSource对象绑定到DataGridView.其中List<string>中存放的都是汉字,DataGridView的AutoGenerateColumns设为true.结果是DataGridView中显示的每行都是List<string>中每一项的汉字的个数,为什么是这个结果?

解决方案 »

  1.   

    因为List中的字符串中几个汉字的都有,很直观的便可以看出DataGridViewCell中显示的是汉字的个数
      

  2.   

    to Jamestan(情商蛋蛋):
    我不太明白您的意思.
      

  3.   

    dataGridView1.AutoGenerateColumns = true;            List<string> sourceList = new List<string>();
                sourceList.Add("情商蛋蛋");
                sourceList.Add("07蓄势,08翱翔");
                sourceList.Add("ABC");
                sourceList.Add("HELLO");            bindingSource1.DataSource = sourceList;
                dataGridView1.DataSource = bindingSource1;
      

  4.   

    输出的结果是:
    Length
    _______
    4
    9
    3
    5值得注意的是"Length"是绑定自动加上的HeaderText,为什么DataGridView会选择Length呢?