There are two forms. On the first form data base with akses. On the second form there is a datagrid, where headers are filled in the form of a square matrix ( Example ). How to make the grid cells automatically resize depending on the text, but it turns out like this: enter image description here

    1 answer 1

    You need to try this type:

    gridview.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells; gridview.AutoResizeColumns(); gridview.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; gridview.AutoResizeRows( DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders);