dataGridView1.Sort(dataGridView1.Columns[0], System.ComponentModel.ListSortDirection.Ascending); The datagridview starts ordering whatever i enter automatically. I thought this was supposed to sort the data only when i ran the command, not make it sort automatically all the time