Skip to Content
0
Former Member
Jul 06, 2009 at 10:37 AM

CFL in Matrix

42 Views

Hi everyone,

1. I have a matrix created in screen painter with two columns: Item No and Item Description. The first column; Item No has a choose from list associated with it.

I would like to select an item from the choose from list and have the description displayed automatically.

The choose from list works fine but when i select an item i get the error: 'Can't set value on item because the item cant get focus' and the item's description does not appear.

2 Only the first two rows of my matrix are editable.

How can i solve this problems.

The code is below.

if ((pVal.ItemUID == "matParts") && (pVal.EventType == SAPbouiCOM.BoEventTypes.et_CHOOSE_FROM_LIST))
                            {
                                SAPbouiCOM.IChooseFromListEvent oCFLEvento = null;
                                oCFLEvento = ((SAPbouiCOM.IChooseFromListEvent)(pVal));
                                string sCFL_ID = null;
                                sCFL_ID = oCFLEvento.ChooseFromListUID;
                                SAPbouiCOM.Form oForm = null;
                                oForm = SBO_Application.Forms.Item(FormUID);
                                SAPbouiCOM.ChooseFromList oCFL = null;
                                oCFL = oForm.ChooseFromLists.Item(sCFL_ID);

                                if (oCFLEvento.BeforeAction == false)
                                {
                                    SAPbouiCOM.DataTable oDataTable = null;
                                    oDataTable = oCFLEvento.SelectedObjects;
                                    string itemCode = null;
                                    string itemDesc;

                                        try
                                        {
                                            itemCode = System.Convert.ToString(oDataTable.GetValue(0, 0));
                                            itemDesc = System.Convert.ToString(oDataTable.GetValue(1, 0));

                                            oItem = oForm.Items.Item("matParts");
                                            oMatrix = ((SAPbouiCOM.Matrix)(oItem.Specific));

                                            oEditItemNo = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("colPart").Cells.Item(oCFLEvento.Row).Specific);
                                            oEditItemNo.Value = itemCode;

                                            oEditItemDesc = ((SAPbouiCOM.EditText)oMatrix.Columns.Item("colPart").Cells.Item(oCFLEvento.Row).Specific);
                                            oEditItemDesc.Value = itemDesc;

                                        }
                                        catch (Exception er)
                                        {
                                            SBO_Application.MessageBox(er.Message, 1, "Ok", "", "");

                                        }

                                }
                            }