DevExpress 中gridControl1改变数据源显示问题

                   var main_dt = ADO.ExecuteDataTable(ADO.sqlString);
                    main_dt.Columns.Add("出货日期", typeof(string));
                    main_dt.Columns.Add("提交时间", typeof(string));
                    for (int i = 0; i < main_dt.Rows.Count; i++)
                    {
                        main_dt.Rows[i]["出货日期"] = GLOBALS.ConvertIntDateTime2str(main_dt.Rows[i]["DA_SDATE"].ToString());
                        main_dt.Rows[i]["提交时间"] = GLOBALS.ConvertIntDateTime2str(main_dt.Rows[i]["DT_POST_TIME"].ToString());
                    }
                    gridControl1.DataSource = main_dt;
                    gridView1.PopulateColumns();//为绑定数据源中的所有字段创建列,这句很重要,没有这句就不显示
posted @ 2022-07-14 10:14  凉介-C  阅读(281)  评论(0编辑  收藏  举报