cancel
Showing results for 
Search instead for 
Did you mean: 

Delete row from system matrix - which row number?

Former Member
0 Kudos

Hello Experts,

I have caught the right click 'Delete Row' menu event on a system matrix (the service contract matrix), and I want to allow deletion only on certain conditions (using before_action = true and bubbleEvent). But how can I find which row number is being deleted?

Thank you

Véronique

Accepted Solutions (0)

Answers (1)

Answers (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos
Public Event RightClickEvent( _
   ByVal eventInfo As ContextMenuInfo, _
   ByRef BubbleEvent As Boolean _
)

eventInfo.Row
Former Member
0 Kudos

Thank you Yatsea, but the rightclick event will only be triggered if I right-click right? In my case, I am clicking on the menu item 'Delete Row' which appears on the context menu on right clicking - so I should be writing the code under MenuEvent right?

Véronique

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

You may get it from the selected row in the current matrix

oMatrix = oApp.ActiveForm.Items.Item("***").specific
Matrix.GetNextSelectedRow()

Public Function GetNextSelectedRow( _
   Optional ByVal FirstRow As Long = 0, _
   Optional ByVal OrderType As BoOrderType = ot_SelectionOrder _
) As Long

Former Member
0 Kudos

But no row is selected when you right click and delete a row. Any other idea?

Véronique

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Véronique,

You should handle both MenuEvent and MenuRightClickEvent in this case.

MenuEvent Hanlder:

Matrix.GetNextSelectedRow()

MenuRightClick Hanlder:

eventInfo.Row

Regards, Yatsea