I have standard datagridview and I have contextmenustrip. My problem is that I need to show this contextmenustrip when user click right mouse button but not on every row! Only on rows I’ve chosen.
I tried this:
dataGridView1.Rows[1].ContextMenuStrip = contextMenuStrip1;
But it doesn’t work.
Sounds to me like you want to open your ContextMenuStrip if your user right clicks the header of your DataGridView’s column that satisfies some condition.
In short: use the DataGridView
MouseDownevent and in that event check for the conditions and if they’re met call theShowmethod of your ContextMenuStrip.Code sample that you may refer: