Jack J
Jack J

Reputation: 67

C# DataGridView programmatically changed selection appearance

enter image description here

While programming I've found out that when I select a row programmatically, it selects the row and highlihgts it however the black arrow on the left does not move. Then it moves when I left-click it to select it manually again.

Could be just a silly question, but it makes me curious.

I wonder if that's how it's meant to be, or would there be any way I can control the black arrow?

Thank you for reading a beginner's question :)

Upvotes: 1

Views: 33

Answers (1)

dotNET
dotNET

Reputation: 35400

DataGridView.SelectedRows and DataGridView.CurrentRow are two distinct properties. One is used to control highlighted rows, whereas the othe ris used to control the black arrow.

In addition to the above, there is DataGridView.SelectedCells too, using which you can select less than a row, or arbitrary non-contiguous selection of cells.

Upvotes: 1

Related Questions