private void FormSupplier_Load(object sender, EventArgs e) { DataTable tableQuery = _bll.GetDataTableGrid( ); tableQuery.Columns.Add("check", typeof(System.Boolean)); gridControl1.DataSource = tableQuery; }
//Refresh private void button3_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(strWhere)) { strWhere = "1=1"; } DataSet ds = new DataSet( ); tableQuery = _bll.GetDataTableGrid(strWhere); tableQuery.TableName = "PQWZ"; ds.Tables.Add(tableQuery); if (strWhere.Contains("A.idx")) { strWhere = strWhere.Replace("A.idx", "WY001"); } tableZ = _bll.GetDataTableZ(strWhere); tableZ.TableName = "PQWY"; ds.Tables.Add(tableZ); DataRelation relation = new DataRelation("本次扣款", ds.Tables ["PQWZ"].Columns ["idx"], ds.Tables ["PQWY"].Columns ["WY001"]); ds.Relations.Add(relation); gridControl1.DataSource = ds.Tables ["PQWZ"]; }