Setting datagrid column width ??

Hi,

How do I set the datagrid column width such that it fits datagrid column's header text or the length of the cell with maximum length.

Thanks,



Answer this question

Setting datagrid column width ??

  • mattpic

    Try this.

    dataGridView1.Columns(1).AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells



  • SCISYS DBA

    ACtually I am using DataGridTextBoxColumn and adding them to DataGridTableStyle. I cant see these property there.
  • Setting datagrid column width ??