-3

I need to fit in all the cells to the data grid view width

enter image description here

  • 2
    Does this answer your question? [DataGridView AutoFit and Fill](https://stackoverflow.com/questions/18666582/datagridview-autofit-and-fill) – Nima Talebi Aug 07 '21 at 09:05

2 Answers2

1

Set "AutoSizeColumnsMode" on "Fill" from data grid view properties

enter image description here

Beginner
  • 27
  • 1
  • 5
0

you could set dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill or setting one to one column like dt.Columns[index of column or "name of the column header"].Width = 30

ToTosty
  • 36
  • 5