We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Popupmenus manager not working properly.

Hi, I am using 1.6.1.8 Popupmenus manager. When a popup menu is assigned to a Groupbox, it is coming up even though when I right click on a control with in the groupbox. 1. Open XPToolbarsAndContextMenus sample. 2. Set the "XPContextMenu on Popupmenusmnager1" to none for richttextbox1. 3. Select the "groupbox1" control and set the "XPContextMenu on Popupmenusmnager1" to popupmenu2 and run it. 4. Right click on the gradient label and notice that the popup menu comes up. In my application, I have a databound grid. popup menu shows up on my grid as well. It should not do display it here. Let me know what is happening. thanks, - Reddy

3 Replies

AS Arun Srinivasan Syncfusion Team November 4, 2003 06:59 PM UTC

Hi Reddy, Yes, that is how context/PopUp Menus will behave. To overcome this, you could listen to the ParentBarItem's BeforePopUp and there you can look for the PopUpMenu's SourceControl and if is is say your grid, then you could cancel the PopUp. Regards, Arun


AD Administrator Syncfusion Team November 4, 2003 08:34 PM UTC

Arun, I added the BeforePopup event handler It is printing "Control = groupBox1" when I right clicked on the gradient label. This is not right. Can you check it out. thanks, - Reddy ----------------------------------- private void parentBarItem2_BeforePopup(object sender, System.ComponentModel.CancelEventArgs e) { Console.WriteLine("Control = " + popupMenu2.SourceControl.Name); } -----------------------------------


AS Arun Srinivasan Syncfusion Team November 6, 2003 09:12 PM UTC

Hi Reddy, Sorry, the SourceControl will return the original control to which the PopupMenu was associated. In order to prevent the Context Menu from showing up when you right click on the grid or any other Child control, you need to assign a dummy context menu. In the XPContextMenusAndToolBars sample, you need to add another PopUpMenu and associate it with the gradientlabel. Now if you right-click the gradientlabel the context menu will not show up, wheras it will if you right click anywhere else in the groupbox. Regards Arun

Loader.
Live Chat Icon For mobile
Up arrow icon