把文本框内容绑定到网格datagridview上,
还有就是可以把文本框内容添加到网格中,然后一起保存起来!高手希望能提供源码!

解决方案 »

  1.   

    如果DATAGRIDVIEW是要和DATATABLE绑定的话,则
    使用BindingSource就可以了BindingSource.DataSource = DataTable;
    DataGridView.DataSource = BindingSource;
    textBox.DataBindings.Add("Text", BindingSource, ".字段名");
      

  2.   

    从文本框截取字符,然后用循环添加到DATAGRIDVIEW,由于在网吧,没VS环境,所以只提供思路!
      

  3.   

    lz说的是文本文件还是文本框?
    文本框就只能用substring一个一个截出来。然后这样做 DataTable dTable = new DataTable();
     DataRow dr = dTable.NewRow();
                dr["1"] = substring1;
                dr["2"] = substring2;
                dr["3"] = substring3;
                dr["4"] = substring4;            dTable.Rows.Add(dr);            this.dataGridView1.DataSource = dTable;