Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataGridView Row Height Autosize

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

like image 344
Khilen Maniyar Avatar asked Oct 16 '10 07:10

Khilen Maniyar


2 Answers

DataGridView.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells

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

like image 60
Yoshi Avatar answered Sep 17 '22 14:09

Yoshi


if you want to change only for particular row :

 int j = Rowindex;  datagridview1.AutoResizeRow(j, DataGridViewAutoSizeRowMode.AllCells); 
like image 33
Harshal Doshi Jain Avatar answered Sep 18 '22 14:09

Harshal Doshi Jain