简体   繁体   中英

VB .NET - Autosize datagridview row height

Problem Definition

So I am trying to do something that should be very basic; however, I can't seem to make it actually work. I am simply trying to make my datagridview autoresize every row height to the text entered. Am I missing something?

What I have tried

I have read through examples on SO and other sites and they all recommend a similar idea. So to make it simple here is exactly what I have done so far:

  1. I created a new datagridview.
  2. I clicked on columns > Add and use the default name and type (textbox)
  3. I kept the Autosizemode of that column at None and DefaultCellStyle WrapMode to True.
  4. I changed the datagridview's AutoSizeRowsMode = AllCells

From there I build my project and type some data in, but the column simply grows the column width and not the row height:

在此处输入图片说明

Am I missing a step somewhere? I purposely put every step I did because I feel like I am just missing something very simple...

去数据网格视图- >属性- >默认细胞样式改变涡卷设置为 ,则使用autosizerow属性像ALLCELLS或显示cellslike任何模式

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM