简体   繁体   English

如何在WinForms中的DataGridView中设置行的高度

[英]How to set the height of a row in a datagridview in winforms

我有一个Datagridview,我需要设置行高,因为我已经注意到,当前正在根据行中显示的图像调整行的大小。

Looks like AutoSizeRowsMode set to none, set it to AllCells . 看起来AutoSizeRowsMode设置为none,将其设置为AllCells

dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;

or if you are looking to set size explicitly based on image size, try setting RowTemplate.Height before binding. 或者,如果您要根据图像大小显式设置大小,请尝试在绑定之前设置RowTemplate.Height

dataGridView1.RowTemplate.Height = 80;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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