Need a bit of a help here please.
I have a DataGridView processing class with various methods ( shown below ).
One of the methods enables Right Mouse click row selection in the DataGridView.
Something is wrong with it though... Right click seems to highlight the row but it doesn't actually select it. The SelectedIndex remains on the first row unless I left click elsewhere.
I can also see a little triangle in the first gray column, indicating selected row, doesn't switch over to right clicked row.
Anyone can tell me whats going on here ?
By the way.. is it possible to disable that first column in the DataGridView that indicates the selected row ?
Thank you in advance.
public GridViewProcessing(DataGridView _grid)
m_grid = _grid;
//This will enable Right click row selection
public DataGridView EnableRightClickSelection(int x, int y)
//Enable DataGridView right click selection
ht = m_grid.HitTest(x, y);
if (ht.Type == DataGridViewHitTestType.Cell)
((DataGridViewRow)m_grid.Rows[ht.RowIndex]).Selected = true;