Figured out a work around.
Instead of listening for SelectionChanged events, I listened for CellMouseClick events and then toggled my own flag for which row is selected.
I also changed the default row style so that there is no indication of which row is selected. Then i added some code to change the row style of whichever row was selected according to my own row.
Below is the code
just for listening to CellMouseClicks on certain columns, the rest is very specific to my application.
void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
// Make sure it is a left click
if(e.Button == MouseButtons.Left)
{
// Make sure it is on a cell
if (e.ColumnIndex >= 0 && e.RowIndex >= 0)
{
// Only allow certain columns to trigger selection changes (1 & 2)
if (e.ColumnIndex == 1 || e.ColumnIndex == 2)
{
// Set my own private selected row index
setSelectedRow(e.RowIndex);
}
else
{
// Actions for other columns...
}
}
}
}