0

I have a windows form application in which i have a datagridview with AllowUserToOrderColumns = true, then user change column order via drag and drop.

How can i know which column is dragged ?

Husain Sanwerwala
  • 479
  • 2
  • 7
  • 13

1 Answers1

0

When you set AllowUserToOrderColumns = true then you will know the column name in ColumnDisplayIndexChanged

Private Sub Datagridview1_ColumnDisplayIndexChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewColumnEventArgs) Handles dgvGuru.ColumnDisplayIndexChanged

     MsgBox(e.Column.Name)

End Sub
matzone
  • 5,703
  • 3
  • 17
  • 20