Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Heather@FootAnstey
Posts : 57
Join date : 2018-12-19

Remove Searchlist Context Menu Empty Remove Searchlist Context Menu

Fri 17 Apr 2020 - 15:12
Original Post: Mike Vaughan (Thompsons) 05/06/2014 12:42:55

"Hi,
we have a requirement to programmatically disable a button on a searchlist on the SearchCompleted event - this ensures the code runs when the Searchlist is a tab. We use the following code to disable the button
SearchControl.ToolBar.Buttons[“cmdAdd”].Enabled = false;
and I'm using the following code to remove the Actions panel altogether (although I would prefer to chose the buttons I want to disable/hide) SearchControl.HidePanelButtons();

The final area is the Context Menu. It appears that even though the button is disabled the context menu is still available. I've tried a few combinations but it appears that the SearchControl.ContextMenu object is NULL so can't be used.


Is there a way to remove/disable the menu items from the Searchlist context menu? thanks"

Responses:

technical 05/06/2014 12:47:21
"Hi,
Have you tried looked at the ContexMenu property of the Parent Objects because I've found that sometimes things seem to be nested a lot in Matter Centre. One Menu was about 3 or 4 Parents deep.
Phil"

Mike Vaughan (Thompsons) 05/06/2014 13:34:08
"I tried 5 levels of Parent and Context menu is null every time. I've tried another way to get to the button property and this seems to do the job SearchControl.GetOMSToolBarButton(“cmdService”).ContextMenuItem.Enabled = false;
This is also the way to get to the panel buttons SearchControl.GetOMSToolBarButton(“cmdService”).PanelButton.Enabled = false; cheers"
Back to top
Permissions in this forum:
You cannot reply to topics in this forum