簡體   English   中英

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

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

我有一個Datagridview,我需要設置行高,因為我已經注意到,當前正在根據行中顯示的圖像調整行的大小。

看起來AutoSizeRowsMode設置為none,將其設置為AllCells

dataGridView1.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells;

或者,如果您要根據圖像大小顯式設置大小,請嘗試在綁定之前設置RowTemplate.Height

dataGridView1.RowTemplate.Height = 80;

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM