471,603 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,603 software developers and data experts.

mouse event won't fire again until click on other cell

Hi,

I need the MouseDown event be trigged everytime when you press mouse in a
datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode
for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original
again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 10 '06 #1
2 2473
Hi there Ryan,

I tried this out and and it seems to work for me. I implemented

private void dataGridView_MouseClick(object sender, MouseEventArgs e)

and evertime I click any cell, even if the cell is already selected, the
MouseClick event is fired. Is this what you are doing? If it is, and you're
still having problems, then could you provide me with some more detail?
Thanks!

"Ryan Liu" wrote:
Hi,

I need the MouseDown event be trigged everytime when you press mouse in a
datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode
for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original
again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 10 '06 #2
Thanks Justin.

Actually later I solved it by change from MouseDown to MouseUp event, and at
the end of event, I change current cell to another cell. This trick won't in
MouseDown event.

While I test Click event for System.Windows.Forms.DataGrid, I found it even
won't fire for the cell, only fired when I click on row headers.

Thanks again!
Ryan
"Justin Swan (MSFT)" <Ju************@discussions.microsoft.com> дʼ
news:1B**********************************@microsof t.com...
Hi there Ryan,

I tried this out and and it seems to work for me. I implemented

private void dataGridView_MouseClick(object sender, MouseEventArgs e)

and evertime I click any cell, even if the cell is already selected, the
MouseClick event is fired. Is this what you are doing? If it is, and you're still having problems, then could you provide me with some more detail?
Thanks!

"Ryan Liu" wrote:
Hi,

I need the MouseDown event be trigged everytime when you press mouse in a datagrid (System.Windows.Forms).
But seems mouse event will only fire once, and it seems changed to edit mode for the cell (even the cell is read). The mouse event won't fire again
until I click on some other cell and come back and click on the original cell again.

Is there a way to make the mouse event always be trigged?

Thanks a lot!
Ryan Liu

Feb 11 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Niels Jensen | last post: by
reply views Thread by Gary Shell | last post: by
9 posts views Thread by jeff | last post: by
1 post views Thread by XIAOLAOHU | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.