void BindGrid1() { ItemGYFlowDtsRule rule = new ItemGYFlowDtsRule(); DataTable dt = rule.RShow(" AND MainID=" + _WPItemID + " ORDER BY Seq", ProcessGrid.GetQueryField(gridView1)); WCommon.AddDtRow(dt, 10); gridView1.GridControl.DataSource = dt; gridView1.GridControl.Show(); }
/// <summary> /// 处理默认数据源 /// 因为特殊性 /// </summary> void ProcItemCompositeDtsDefault() { if (HTFormStatus == FormStatus.新增 || HTFormStatus == FormStatus.修改)//处理默认数据源 { DataTable dt = (DataTable)gridView2.GridControl.DataSource; if (dt.Rows.Count < 2) { WCommon.AddDtRow(dt, 2); } if (SysConvert.ToInt32(dt.Rows[0]["ComTypeID"]) == 0)//面布 { dt.Rows[0]["ComTypeID"] = 1; } if (SysConvert.ToInt32(dt.Rows[1]["ComTypeID"]) == 0)//底布 { dt.Rows[1]["ComTypeID"] = 2; } } }