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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GDBG Popup menu problem

Thread ID:

Created:

Updated:

Platform:

Replies:

28957 May 12,2005 04:33 PM May 13,2005 10:09 PM Windows Forms 5
loading
Tags: GridControl
Stan Sajous
Asked On May 12, 2005 04:33 PM

I have a GridDataBoundGrid which has a Syncfusion PopupMenu attatched as a context menu. My problem is when a cell is left-clicked on and put into edit mode, then immediately right-clicked on to bring up the popup menu, the application hangs. This will only happen when that is the first attempt to bring up the popup menu. If I right-click on an inactive cell the popup displays correctly and from that point forward even right-clicking in edit-mode cells will work. But if I bring up a fresh form and try to bring up the context menu from an edit-mode cell the app dies. I''ve attached a sample project that illustrates the problem. Stan Sajous

Administrator [Syncfusion]
Replied On May 13, 2005 08:22 AM

Did you attached the sample you intended to attach? It uses a GridControl and does not have any context menus set up????

Stan Sajous
Replied On May 13, 2005 09:06 AM

Sorry about that. Similar names. . . The real sample >Did you attached the sample you intended to attach? It uses a GridControl and does not have any context menus set up????

Administrator [Syncfusion]
Replied On May 13, 2005 12:50 PM

I was able to avoid this problem by assigning the contxt menu to the embedded cell control after setting the grid''s datasource. grdTest.DataSource = Employees1.Employees Me.PopupMenusManager1.SetXPContextMenu(Me.grdTest.CellRenderers("TextBox").Control, Me.PopupMenu1)

Stan Sajous
Replied On May 13, 2005 03:19 PM

I tried this and it doesn''t completely avoid the problem. It fixes it for the text box cells, but then the exact same issue arises for any combo box cells. So the issue was only shifted. I tried adding the line: Me.PopupMenusManager1.SetXPContextMenu(Me.grdTest.CellRenderers("ComboBox").Control, Me.PopupMenu1) but received a ArgumentNullException. I also tried looping through grdTest.CellRenderers but again received exceptions. Is there any way to set the popup menu to activate on all the cell renderer types in a a given grid? >I was able to avoid this problem by assigning the contxt menu to the embedded cell control after setting the grid''s datasource. > > >grdTest.DataSource = Employees1.Employees >Me.PopupMenusManager1.SetXPContextMenu(Me.grdTest.CellRenderers("TextBox").Control, Me.PopupMenu1) >

Administrator [Syncfusion]
Replied On May 13, 2005 10:09 PM

You can do this dynamically by subscribing to these events in Form.Load. AddHandler grdTest.CurrentCellControlGotFocus, AddressOf grid_CurrentCellControlGotFocus AddHandler grdTest.CurrentCellControlLostFocus, AddressOf grid_CurrentCellControlLostFocus Then in the handlers, set and clear teh context menus.
   Private Sub grid_CurrentCellControlGotFocus(ByVal sender As Object, ByVal e As ControlEventArgs)
        Me.PopupMenusManager1.SetXPContextMenu(e.Control, Me.PopupMenu1)
    End Sub

    Private Sub grid_CurrentCellControlLostFocus(ByVal sender As Object, ByVal e As ControlEventArgs)
        Me.PopupMenusManager1.SetXPContextMenu(e.Control, Nothing)
    End Sub

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;