Datatable 增加一列并为该列赋上相应的值
DataTable dt = new DataTable(); dt.Columns.Add("Name1", typeof(int)); dt.Columns.Add("Name2", typeof(object)); dt.Columns.Add("Name3", typeof(object)); for (int i = 0; i < 200; i++) { dt.Rows.Add( i, "款号" + Convert.ToString(i), "色号" + Convert.ToString(i)); } gridControl1.DataSource = dt;
___________________________________________________________________________________________________________
===========================================================================================================
DataTable dt = new DataTable(); dt.Columns.Add("Name1", typeof(int)); dt.Columns.Add("Name2", typeof(object)); dt.Columns.Add("Name3", typeof(object)); for (int i = 0; i < 200; i++) { dt.Rows.Add( i, "款号" + Convert.ToString(i), "色号" + Convert.ToString(i)); } gridControl1.DataSource = dt;
作者:Kevin
邮箱:334081981@qq.com
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利.

浙公网安备 33010602011771号