Right Click in Selected Datagrid cell brings up default ContextMenu


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Right Click in Selected Datagrid cell brings up default ContextMenu

  1. #1
    Join Date
    Jul 2005
    Posts
    4

    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,
    Flip

  2. #2
    Join Date
    Jul 2005
    Posts
    3
    You don't have to use conn.open() and conn.close() when using da.fill or da.update.

  3. #3
    Join Date
    Jul 2005
    Posts
    4

    Here's the answer

    I found my answer in the following forum

    Net247_Forums

    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
    http://support.microsoft.com/support.../q321/2/96.asp

    Dim c As DataGridTextBoxColumn
    For Each c In Me.DataGrid1.TableStyles(0).GridColumnStyles
    c.TextBox.ContextMenu = ContextMenu1
    Next


    Regards,
    Elan Zhou
    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? http://www.gotdotnet.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center