By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,492 Members | 1,351 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,492 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.