1,将需要进行排序的列做属性的设置 this.colUserName.SortMode = DataGridViewColumnSortMode.Programmatic; 2,添加列的事件 //点击列头进行排序 private void dgv_NoSignalSelect_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { int nColumnIndex = e.ColumnIndex; if…