grdTest.DataSource = Employees1.Employees
Me.PopupMenusManager1.SetXPContextMenu(Me.grdTest.CellRenderers("TextBox").Control, Me.PopupMenu1)
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)
>
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