cancel
Showing results for 
Search instead for 
Did you mean: 

Why there is no menu "Delete Row" display when I right click on my UDF?

Former Member
0 Kudos

Why there is no menu "Delete Row" display when I right click on my UDF? How to add it? Please let me know. Appreciate.

Ying Zhang

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

in a user Matrix you have to program the rightclick remove line by yourself

use the RightClickEvent for this:

i give you a c# sample


        SAPbouiCOM.MenuItem oMenuItem = null;
        SAPbouiCOM.Menus oMenus = null;
        SAPbouiCOM.MenuCreationParams oCreationPackage = null;

        try
        {
                    if (eventInfo.BeforeAction == true)
                    {
                        oCreationPackage = ((SAPbouiCOM.MenuCreationParams)(globals.SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)));

                        oCreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING;
                        oCreationPackage.UniqueID = "DelRow";
                        oCreationPackage.String = "Zeile löschen";
                        oCreationPackage.Enabled = true;

                        oMenuItem = globals.SBO_Application.Menus.Item("1280"); // data'
                        oMenus = oMenuItem.SubMenus;
                        oMenus.AddEx(oCreationPackage);
                    }
                    else
                    {
globals.SBO_Application.Menus.RemoveEx("DelRow");

        }        catch (Exception er)
        {

        }
        finally
        {
            oMenuItem = null;
            oMenus = null;
            oCreationPackage = null;
            GC.Collect();
        }

what you have to do it is to catch the pval.menuid from the menuevent and remove it by yourself

much luck

and when your are happy reward me )

regards

David

Former Member
0 Kudos

Hi David,

Your answer is very helpful. I already added the menu of "Delete Row". I will do the coding to dalete the row.

Thanks.

Ying

Answers (0)