private void button1_Click(object sender, EventArgs e) { //criar um formulário com dois matrix this.oForm = UIHelper.CriarForm(this.oApplication, SAPbouiCOM.BoFormBorderStyle.fbs_Sizable, "TypeFrmMatrix", "UidFrmGrid", 200, 600, true, 0, "Matrix e Celulas", 250, 740, 44, 366); this.oButtonOK = UIHelper.AddBotaoAoFormulario(this.oForm, "1", 5, 65, 170, 19, "Ok", false); this.oButtonCancel = UIHelper.AddBotaoAoFormulario(this.oForm, "2", 75, 65, 170, 19, "Cancel", false); AddDataSources(); this.oMatrix1 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix1", 360, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto); this.AddColunasMatrix1(this.oMatrix1); this.setMatrix(ref this.oMatrix1); this.oMatrix2 = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix2", 5, 361, 5, 150, SAPbouiCOM.BoMatrixSelect.ms_Auto); this.AddColunasMatrix1(this.oMatrix2); this.setMatrix(ref this.oMatrix2); this.oForm.Settings.Enabled = true; this.oForm.Visible = true; this.btnMudarGrid.Enabled = true; this.btnMatrix.Enabled = false; }
private void button1_Click(object sender, EventArgs e) { int iColCount = 0; this.oMatrix = UIHelper.AddMatrixAoFormulario(this.oForm, "Matrix", 10, (this.oForm.ClientWidth - 10), 5, ((this.oForm.ClientHeight / 2) - 10), SAPbouiCOM.BoMatrixSelect.ms_Auto); this.oMatrix.Layout = SAPbouiCOM.BoMatrixLayoutType.mlt_Normal; this.oDBDataSource = oForm.DataSources.DBDataSources.Add("OCRD"); this.oDBDataSource1 = oForm.DataSources.DBDataSources.Add("OITM"); this.oDBDataSource2 = oForm.DataSources.DBDataSources.Add("OINV"); this.oDBDataSource3 = oForm.DataSources.DBDataSources.Add("INV1"); //add coluna 1 MatrixHelper.addoColumn(this.oMatrix, "Col" + iColCount.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT, 0 , "#", "", false, false, "", "", false, 1); iColCount++; //add coluna 2 MatrixHelper.addoColumn(this.oMatrix, "Col" + iColCount.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT, 70 , "CardCode", "", false, true, "OCRD", "CardCode", true, 0); iColCount++; //add coluna 3 MatrixHelper.addoColumn(this.oMatrix, "Col" + iColCount.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT, 100 , "Item - OITM", "ItemCode", false, true, "OITM", "ItemCode", true, 0); iColCount++; //add coluna 4 MatrixHelper.addoColumn(this.oMatrix, "Col" + iColCount.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT, 80 , "DocDate", "DocDate", false, true, "OINV", "DocDate", false, 0); iColCount++; //add coluna 5 MatrixHelper.addoColumn(this.oMatrix, "Col" + iColCount.ToString(), SAPbouiCOM.BoFormItemTypes.it_EDIT, 80 , "Numero", "Numero", false, true, "INV1", "LineTotal", false, 0); iColCount++; this.oMatrix.Clear(); this.oMatrix.AutoResizeColumns(); this.oDBDataSource.Query(null); this.oDBDataSource1.Query(null); this.oDBDataSource2.Query(null); this.oDBDataSource3.Query(null); this.oMatrix.LoadFromDataSource(); }