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

  • Thread starter Thread starter Ryan Liu
  • Start date Start date
R

Ryan Liu

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
 
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!
 
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
 
Back
Top