private void LoadData() { var data = context.layDanhSachCanHoDichVu(); DataTable dt = new DataTable(); DataColumn dc0 = new DataColumn("Mã căn hộ", typeof(string)); DataColumn dc1 = new DataColumn("Tầng", typeof(string)); DataColumn dc2 = new DataColumn("Mã dịch vụ", typeof(string)); DataColumn dc3 = new DataColumn("Tên dich vụ", typeof(string)); DataColumn dc4 = new DataColumn("Chi phí/tháng", typeof(string)); dt.Columns.Add(dc0); dt.Columns.Add(dc1); dt.Columns.Add(dc2); dt.Columns.Add(dc3); dt.Columns.Add(dc4); foreach (var item in data) { DataRow row = dt.NewRow(); row[0] = item.maCH.ToString().Trim(); row[1] = item.tang.ToString().Trim(); row[2] = item.maDV.ToString().Trim(); row[3] = item.ten.ToString().Trim(); row[4] = item.chiphi.ToString().Trim(); dt.Rows.Add(row); } gridControl.DataSource = dt; gridView1.Columns[0].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridView1.Columns[1].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridView1.Columns[2].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridView1.Columns[3].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; gridView1.Columns[4].AppearanceHeader.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center; }