capture mouse click on empty part of dgv

Заблокировано capture mouse click on empty part of dgv

  • 6 марта 2012 г. 23:37
     
     
    I'm trying to capture a right mouse click when the mouse is over an empty part of a dgv. The dgv doesn't capture the click, nor does the underlying form. Any ideas would be greatly appreciated. Thank you.

Все ответы

  • 7 марта 2012 г. 0:06
     
     Предложенный ответ

    Hi, 

    Do you mean DataGridView? 

    When you say dataGridView.MouseClick += , gridview control fires the event irrespective of the place, header, row, column, empty space..., where you click.

    If you elaborate your issue may be we will help you..


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

  • 7 марта 2012 г. 7:09
    Модератор
     
     
    Hi Tom,

    Could you be more specific on your graphical application type? Do you mean WPF, WinForm or Silverlight?
    Thanks for your understanding.

    Have a nice day,

    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us

  • 7 марта 2012 г. 20:01
     
     Отвечено

    Sorry,

    I did mean datagridview and I am talking about a WinForm.

    I've found the problem. I was using the CellMouseClick on an empty part of the datagridview instead of the MouseDown event.

    Thank you for your responses.

    • Предложено в качестве ответа Leo Liu - MSFTModerator 8 марта 2012 г. 7:45
    • Помечено в качестве ответа Tom Cast 8 марта 2012 г. 16:06
    •  
  • 8 марта 2012 г. 7:47
    Модератор
     
     
    So should you close this thread now by marking some replies you think to be helpful? The proposed ones may be the candidates.
    Have a nice day,

    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us