cancel
Showing results for 
Search instead for 
Did you mean: 

UDO, Context menu

Former Member
0 Kudos

Hi All,

I am developing a UDO form. I need to make "Context Menu" -> "Insert Row" work.

I've seen in the forum, that I need to program this myself. The problem is that I can not figure out how to find the number of the row where the cursor is placed when the user right clicks to get the context menu.

I can make things work if I select the line first (make it orange) and then use the function Matrix.GetNetSelectedRow, but the built-in functionality of Delete Line does not require that I select the row first.

Any help appriciated

Rgds

Jesper Carstensen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I capture the row number using this code in ItemEvent:

If pVal.ItemUID = "MyMatrixUID" And pVal.EventType = et_Click And pVal.BeforeAction = False Then

If pVal.Row > 0 Then

myRow = pVal.Row

Else

myRow = 0

End If

End If

Applying the row number to your Matrix.AddRow method should do the trick.

I hope the above helps.

Answers (1)

Answers (1)

rasmuswulff_jensen
Active Contributor
0 Kudos

the itemevents pval have a Row Property.. Use that

Former Member
0 Kudos

Yeah, not really, because I do not get an ItemEvent but a MenuEvent, which does not contain a row indication

Rgds

Jesper Carstensen

rasmuswulff_jensen
Active Contributor
0 Kudos

Then you will first be able to solve it with the RightClick-event presented from SBO2005A SDK. The right-click event have the Row Property