Skip to Content
0
Jul 07, 2020 at 10:47 AM

SetLineData(i) changing values of al matrix rows

98 Views

HI all,

Im trying to set the value of a particular rows userdatasource bound matrix column value. But it seems like all the rows value gets changed. Please assist.

private void OnCustomInitialize()
{ //GET THE USER DATA SOURCE
Uds = this.UIAPIRawForm.DataSources.UserDataSources;
//ADD new datasource Uds.Add("MX_DESC", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 100);
//BIND Matrix COLUMN this.mtxContents.Columns.Item("colItmName").DataBind.SetBound(true, "", "MX_DESC");
this.mtxContents.Columns.Item("colItmName").ChooseFromListUID = "cflOITM2";
this.mtxContents.Columns.Item("colItmName").ChooseFromListAlias = "ItemName";
} //SET VALUE IN THE EVENT private void MtxContents_ChooseFromListAfter(object sboObject, SBOItemEventArg pVal) { Matrix mat = null; if (pVal.ActionSuccess) { SBOChooseFromListEventArg oCFLEvento = (SBOChooseFromListEventArg)pVal; var dataTable = oCFLEvento.SelectedObjects; var itemName = dataTable.GetValue("ItemName", 0).ToString(); mat = this.mtxContents; mat.GetLineData(pVal.Row); Uds.Item("MX_DESC").ValueEx = itemName; mat.SetLineData(pVal.Row); } }