Hi,
Try it like this:
if ((pVal.ItemUID == "Matrix") && (pVal.ColUID == "colItemCode") && pVal.EventType == BoEventTypes.et_CHOOSE_FROM_LIST && pVal.FormMode != 0)
{
SAPbouiCOM.ChooseFromListEvent cflevent = (SAPbouiCOM.ChooseFromListEvent)pVal;
SAPbouiCOM.ChooseFromList oCFLEvento = default(SAPbouiCOM.ChooseFromList);
string strUid = cflevent.ChooseFromListUID;
oCFLEvento = this.m_SBO_Form.ChooseFromLists.Item(strUid);
SAPbouiCOM.DataTable oDataTable = cflevent.SelectedObjects;
SAPbobsCOM.Recordset oRecSet = (SAPbobsCOM.Recordset)SBO_Company.GetBusinessObject(BoObjectTypes.BoRecordset);
if (oDataTable == null)
{
m_SBO_Form.Freeze(false);
return;
}
SAPbouiCOM.EditText oEdit = default(SAPbouiCOM.EditText);
SAPbouiCOM.Matrix oMatrixItem = (SAPbouiCOM.Matrix)this.m_SBO_Form.Items.Item(pVal.ItemUID).Specific;
int i = 0;
int Row = pVal.Row;
for (i = 0; i <= oDataTable.Rows.Count - 1; i++)
{
string ItemCode = oDataTable.GetValue("ItemCode", i).ToString();
try
{
oEdit = (SAPbouiCOM.EditText)oMatrixItem.Columns.Item("colItemCode").Cells.Item(Row).Specific;
oEdit.Value = oDataTable.GetValue("ItemCode", i).ToString();
}
catch { }
}
Hope it helps.
Kind regards,
ANKIT CHAUHAN
SAP Business One Global Support