For Each col As DataGridViewColumn dgvJournalData. In the Columns
Col. SortMode=DataGridViewColumnSortMode. NotSortable
Next
DgvJournalData. ColumnHeadersDefaultCellStyle. Alignment.=DataGridViewContentAlignment MiddleCenter
To cancel the order, and set to ColumnHeadersDefaultCellStyle MiddleCenter, but the look and feel is not centered,
For what is the solution
CodePudding user response:
Cancel the order,Foreach (DataGridViewColumn item in this. DgvStudentList. Columns)
{item. SortMode=DataGridViewColumnSortMode. NotSortable;
}
Then interface, column headings, see whether SortMode property (sorting mode) for NotSortable