初始化控件

public void iniUserControl() { ReportDataLayer mReportDataLayer = ReportDataLayer.CreateInstance(); ProductLineDataSetByCondition LineDs = new ProductLineDataSetByCondition(); LineDs = mReportDataLayer.GetProductLineDataByCondition("", "", -1); this.WorkGroupDs = mReportDataLayer.GetWorkGroupByCondition("", "", -1, ""); LineDs.productLine.DefaultView.Sort = LineDs.productLine.productLineNameColumn.ColumnName; this.WorkGroupDs.Tables["workGroup"].DefaultView.Sort = "workGroupName"; this.comGroup.DataSource = this.WorkGroupDs.Tables["workGroup"]; this.comGroup.ValueMember = "workGroupID"; this.comGroup.DisplayMember = "workGroupName"; this.WorkGroupDs.Tables["workGroup"].DefaultView.RowFilter = "true"; this.comGroup.SelectedIndex = -1; this.comLine.ValueMember = LineDs.productLine.productLineIDColumn.ColumnName; this.comLine.DisplayMember = LineDs.productLine.productLineNameColumn.ColumnName; this.comLine.DataSource = LineDs.productLine; LineDs.productLine.DefaultView.RowFilter = "true"; this.comLine.SelectedIndex = -1; this.comLine.TextChanged += new EventHandler(comLine_SelectedIndexChanged); this.comGroup.TextChanged += new EventHandler(comGroup_SelectedIndexChanged); } public void emptySelection() { this.comLine.Text = ""; this.comGroup.Text = ""; this.groupID = -1; }

你可能感兴趣的:(初始化控件)