2013-10-6 datagridview实现换行并自动设置行高

datagridview设置换行,如下,文本设置\r\n即可换行

dv4.DefaultCellStyle.WrapMode = DataGridViewTriState.True;

dv4.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;

dv1.Columns[dv1.Columns.Count - 1].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; //扩展某列填充剩余空间

 

dv.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCellsExceptHeaders; ///根据数据内容自动调整行高

转载于:https://www.cnblogs.com/mol1995/p/5969640.html

你可能感兴趣的:(2013-10-6 datagridview实现换行并自动设置行高)