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

GDBG Popup menu problem

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

5 Replies

AD Administrator Syncfusion Team May 13, 2005 07:22 AM

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


SS Stan Sajous May 13, 2005 08: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????


AD Administrator Syncfusion Team May 13, 2005 11:50 AM

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)


SS Stan Sajous May 13, 2005 02: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) >


AD Administrator Syncfusion Team May 13, 2005 09: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

Loader.
Live Chat Icon For mobile
Up arrow icon