Right Click in Selected Datagrid cell brings up default ContextMenu
I have a problem with the datagrid context menu system. If the selected cell within a datagrid is right clicked on, the context menu set in the datagrid.contextmenu does not popup. Also, any mouse click events are not fired. Is there a work around for this. If I click off of the selected cell everything works great.
Thanks in advance,
You don't have to use conn.open() and conn.close() when using da.fill or da.update.
Here's the answer
I found my answer in the following forum
Here's a snippet from that forum. The Key is DataGridTextBoxColumn!!!
For the scenario in the following article, you can add the following code
to the end of the Form1_Load() event to hook the context menu for the cells.
HOW TO: Access Properties of Current Cell in DataGrid Using VB
Dim c As DataGridTextBoxColumn
For Each c In Me.DataGrid1.TableStyles(0).GridColumnStyles
c.TextBox.ContextMenu = ContextMenu1
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net? http://www.gotdotnet.com
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center