I have a datagridview with the AllowUserToOrderColumns property set to true.
I also have a column at the end of the grid which has AutoSizeMode set to fill, this serves to fill the grid so that rows look "complete"
How would I mark this column to disable reordering on this column only?
I have tried something like the following
Private Sub dgvAdjustments_ColumnDisplayIndexChanged(sender As Object, e As DataGridViewColumnEventArgs) Handles dgvAdjustments.ColumnDisplayIndexChanged
If e.Column Is TheFillerColumn Then
e.Column.DisplayIndex = theGrid.Columns.Count - 1
End If
End Sub
Which this post How to get dragged column in datagridview when AllowUserToOrderColumns = true sort of suggested
However trying to do what I want to do in this event throws an error as you can't set the display index on a column that is being adjusted.
Regards.