locked
capture mouse click on empty part of dgv

    問題

  • 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.
    2012年3月6日 下午 11:37

解答

  • 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.

    2012年3月7日 下午 08:01

所有回覆

  • 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".

    2012年3月7日 上午 12:06
  • 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

    2012年3月7日 上午 07:09
  • 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.

    2012年3月7日 下午 08:01
  • 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

    2012年3月8日 上午 07:47