Home > Net >  For help on DataGridView column headings not centered
For help on DataGridView column headings not centered

Time:01-09

 
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
  •  Tags:  
  • C#
  • Related