Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Catch the right click of the mouse and highlight only the cell in datagridview

$
0
0

Hi folks,

I have a datagridview with filled cells in it. If I click right a contexrmenu pops up. How can I select the cell and only the cell which must be highlighted when I click the cell and not the entire row. Th ecode I tryed:

            if (e.Button == MouseButtons.Right)
            {
                dgvLoginReaparatie.Rows[e.RowIndex].Selected = true;
            }

All in the MouseDown event.

Thanks

Rinaldo


Full of ideas but don´t know how.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>