protected override void InitializeBizView() { base.InitializeBizView(); XBindingList bindingList = new XBindingList(); indicatorControl = new XIndicatorControl(); indicatorControl.Location = new System.Drawing.Point(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); indicatorControl.Category = "Val_restrptlab"; indicatorControl.TitleName = "Name_srv"; indicatorControl.Type = "Sd_restrptlabtp"; indicatorControl.ValueString = "Val_rstrptla"; indicatorControl.Unit = "Name_unit";// indicatorControl.TopSpace = 0; indicatorControl.LeftSpace = 0; indicatorControl.RenderWidth = 230; indicatorControl.RenderTitleWidth = 60; indicatorControl.ColumnSpace = 0; indicatorControl.RenderTitleWidth = 114; Dictionary <string, Control> controls = new Dictionary <string, Control>(); controls.Add("item", indicatorControl); this.GetXapFormControl().RegisterControl(controls); this.SetFormId(CiOrdBillFormTmplConst.CIORD_OP_EmsOpsViewCard /*"201606130356497205ZD"*/); this.SetGridPageCode("table"); this.RegisteFormEventImpl(); this.allowEdit = true; }
private void InitializeComponent() { // this.xapFormControl = new xap.rui.control.forms.view.XapFormControl(); this.SuspendLayout(); XBindingList bindingList = new XBindingList(); indicatorControl = new xap.rui.bizcontrol.IndicatorControl.XIndicatorControl(); indicatorControl.Location = new System.Drawing.Point(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); //indicatorControl.BindingList = bindingList; indicatorControl.Category = "Val_restrptlab"; indicatorControl.TitleName = "Name_srv"; indicatorControl.Type = "Sd_restrptlabtp"; indicatorControl.ValueString = "Val_rstrptla"; indicatorControl.Unit = "Name_unit"; indicatorControl.TopSpace = 0; indicatorControl.LeftSpace = 1; indicatorControl.RenderWidth = 238; indicatorControl.RenderTitleWidth = 84; indicatorControl.ColumnSpace = 8; System.Collections.Generic.Dictionary <string, System.Windows.Forms.Control> controls = new System.Collections.Generic.Dictionary <string, System.Windows.Forms.Control>(); controls.Add("checkitem", indicatorControl); this.GetXapFormControl().RegisterControl(controls); this.Name = "OrderApbtView"; this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// 动态指标的布局 /// </summary> private void SetIndicatorControl() { XBindingList bindingList = new XBindingList(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); indicatorControl.TopSpace = 0; indicatorControl.LeftSpace = 11; indicatorControl.RenderWidth = xap.cli.sdk.common.RelativeUIParam.RELATIVERATIO > xap.cli.sdk.common.RelativeUIParam.TEMPLETECHANGEDRATIO ? 256 : 230; indicatorControl.RenderTitleWidth = xap.cli.sdk.common.RelativeUIParam.RELATIVERATIO > xap.cli.sdk.common.RelativeUIParam.TEMPLETECHANGEDRATIO ? 154 : 144; indicatorControl.RowSpace = xap.cli.sdk.common.RelativeUIParam.RELATIVERATIO > xap.cli.sdk.common.RelativeUIParam.TEMPLETECHANGEDRATIO ? 10 : 5; indicatorControl.ColumnSpace = xap.cli.sdk.common.RelativeUIParam.RELATIVERATIO > xap.cli.sdk.common.RelativeUIParam.TEMPLETECHANGEDRATIO ? 20 : 12; indicatorControl.BindingList = bindingList; indicatorControl.DataSource = EmsHeadDO.Emsapbt.BtLabItem; }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.xapFormControl = new xap.rui.control.forms.view.XapFormControl(); this.SuspendLayout(); XBindingList bindingList = new XBindingList(); indicatorControl = new xap.rui.bizcontrol.IndicatorControl.XIndicatorControl(); indicatorControl.Location = new System.Drawing.Point(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); // indicatorControl.BindingList = bindingList; indicatorControl.Category = "Val_restrptlab"; indicatorControl.TitleName = "Name_srv"; indicatorControl.Type = "Sd_restrptlabtp"; indicatorControl.ValueString = "Val_rstrptla"; indicatorControl.Unit = "Name_unit";// // this.xapFormControl.Padding = new Padding(0, 0, 0, 0); System.Collections.Generic.Dictionary <string, System.Windows.Forms.Control> controls = new System.Collections.Generic.Dictionary <string, System.Windows.Forms.Control>(); controls.Add("item", indicatorControl); // // xapFormControl1 // this.xapFormControl.AutoSize = true; //this.xapFormControl.AutoValidate = System.Windows.Forms.AutoValidate.EnableAllowFocusChange; //this.xapFormControl1.CanShowing = null; this.xapFormControl.Context = null; this.xapFormControl.File = null; this.xapFormControl.Dock = System.Windows.Forms.DockStyle.Fill; this.xapFormControl.Location = new System.Drawing.Point(3, 3); this.xapFormControl.Name = "xapFormControl1"; this.xapFormControl.Size = new System.Drawing.Size(512, 462); this.xapFormControl.TabIndex = 0; this.xapFormControl.ViewFile = null; this.xapFormControl.RegisterControl(controls); // // OrderOperView // //this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AddRender(this.xapFormControl); this.Name = "OrderOperView"; this.Size = new System.Drawing.Size(573, 468); this.ResumeLayout(false); this.PerformLayout(); }
private void SetIndicatorControl() { var emsdto = (GetViewModel().GetEmsUIDTO() as EmsUIDTO); var bindingList = new XBindingList(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); foreach (OrdApSugViewItemDO itemDo in emsdto.Emsapbt.BtLabItem) { if (itemDo.Val_rstrptla == null) { itemDo.Val_rstrptla = ""; } } indicatorControl.BindingList = bindingList; indicatorControl.DataSource = emsdto.Emsapbt.BtLabItem; indicatorControl.Enabled = this.allowEdit; }
protected override void OnXapFormControl_ModelFilled(object sender, EventArgs e) { base.OnXapFormControl_ModelFilled(sender, e); ResetColumnsInfo(this.GetGridControl()); // 数据模型存在 if (this.GetViewModel() != null && !this.GetViewModel().IsEmpty()) { GetGridControl().DataTable.DataSource = this.GetViewModel().GetTableDataSource(); // 处理变动列表中的数据 XBindingList bindingList = new XBindingList(); bindingList.Add(new XBinding("ValueText", "Val_rstrptla")); indicatorControl.BindingList = bindingList; var ds = new XapDataList <OrdApSugViewItemDO>(); OrdApSugViewItemDO[] itemList = (this.GetViewModel().GetFormDataSource() as EmsOpitemDO).OpLabItem.ToArray(); foreach (OrdApSugViewItemDO item in itemList) { if (item.Status != DOStatus.DELETED) { ds.Add(item); } } indicatorControl.DataSource = ds; indicatorControl.Visible = ds.Count != 0; } else { // 模型不存在则创建一个空的数据模型列表 XapDataList <EmsOpitemDO> ds = new XapDataList <EmsOpitemDO>(); ds.Add(new EmsOpitemDO()); GetGridControl().DataTable.DataSource = ds; indicatorControl.Visible = false; } AdjustLayout(); this.SetFocus(); }