DataGridView Row Height Autosize

Khilen Maniyar picture Khilen Maniyar · Oct 16, 2010 · Viewed 62.6k times · Source

Hi i am using the DataGridView in the C#.Net 3.5 and i want the height of the all row is set to Autosize.. i have defined the WrapMode = true but not getting the Height Autosize

So plz guide me

Thanks

Answer

Yoshi picture Yoshi · Oct 21, 2010

DataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells

See http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.autosizerowsmode.aspx