Finally the summary of the thread:
it's not possible to attach a LinkedButton to a column handled by sap (does not matter if UDF or not) and it's not possible to change the Type property.
The only possible workaround is to manually add a new column and hide the one added by sap, it is necessary to work in the FormLoadBefore event, making sure the matrix be empty while adding the new column.
Thanks to Pedro Magueija
Here the sample C# code I used to test:
protected override void OnFormLoadBefore(SAPbouiCOM.SBOItemEventArg pVal, out bool BubbleEvent) { base.OnFormLoadBefore(pVal, out BubbleEvent); if (BubbleEvent) { SAPbouiCOM.Matrix matrix = this.UIAPIRawForm.Items.Item("38").Specific as SAPbouiCOM.Matrix; matrix.DeleteRow(1); var col = matrix.Columns.Add("C_HT1ITEMW", SAPbouiCOM.BoFormItemTypes.it_LINKED_BUTTON); col.DataBind.SetBound(true, "POR1", "U_HT1ITEMW"); col.TitleObject.Caption = "Articolo C.Lavoro"; col.Width = 150; col.Visible = true; col.Editable = true; var link = (SAPbouiCOM.LinkedButton)col.ExtendedObject; link.LinkedObject = SAPbouiCOM.BoLinkedObject.lf_Items; matrix.AddRow(); } }
Regards,
D.