datatable绑定数据源

            DataTable dt = new DataTable();

            dt.Columns.Add("clmn1", System.Type.GetType("System.String"));

            dt.Columns.Add("clmn2", System.Type.GetType("System.String"));


            for (int i = 0; i < 3; i++)
            {
                DataRow dr = dt.NewRow();
                dr["clmn1"] = "content" + i;
                dr["clmn2"] = "content" + i;
                dt.Rows.Add(dr);
            }
            gridControl1.DataSource = dt;            

  

posted @ 2018-10-31 10:04  A-GREATE-USERNAME  阅读(936)  评论(0编辑  收藏  举报