Results 1 to 3 of 3

Thread: Disable Right click in DataGrid

  1. #1
    ganapathi is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Jul 2004
    Posts
    14
    Reputation
    110

    Lightbulb Disable Right click in DataGrid

    Hi All,

    I've populated a datagrid and made it as a read only. I've a context menu assigned to the grid. When i click on a cell and right click on the same cell, then the default textbox's right click menu option (Cut/Copy/Paste) is comming. How do i disable that and make my context ment to appear?

    Can any one help on this????

    Regards,
    Ganapathi

  2. #2
    jpetter7 is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Jul 2004
    Posts
    16
    Reputation
    110
    An odd, and most likely not the best solution is to use the x/y coordinate system to disable the context menu. then set the mouse down event to mean the right mouse button and do nothing.

    handles mybase.mousedown
    if e.x = area of grid and e.y area of grid then
    disable context menu

    Sorry,,, I am new and use a book, but I have used this for similiar solutions

  3. #3
    ganapathi is offline VB.NET Forum Newbie
    .NET Framework
    Join Date
    Jul 2004
    Posts
    14
    Reputation
    110
    Thanks for your suggessions.

    I've found another way to do this. That is i'm disabling the textboxes in the grid through the datagrid column style object. This disables all the cells but not the grid. so my popup menu is displaying.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking