使用 IComparer 接口自定义排序 public class RowComparer : System.Collections.IComparer { private static int sortOrderModifier = 1; public RowComparer(SortOrder sortOrder) { if (sortOrder == SortOrder.Descending) { sortOrderModifier = -1; } else if (sortOrder == SortOrder.Ascending) { sortOrderModifier = 1; } } public int Compare(object x, object y) { DataGridViewRow DataGridViewRow1 = (DataGridViewRow)x; DataGridViewRow DataGridViewRow2 = (DataGridViewRow)y; // Try to sort based on the First Cells int CompareResult = System.String.Compare(DataGridViewRow1.Cells[0].Value.ToString(),DataGridViewRow2.Cells[0].Value.ToString()); // If the Last Names are equal, so