DataGridView setting row height doesn't work

前端 未结 4 1025
一生所求
一生所求 2021-01-12 20:00

Trying to set RowHeight like this(in code):

dgvTruckAvail.RowTemplate.Height = 48;

Doesnt\' work. I also tried to set Height of every colum

相关标签:
4条回答
  • 2021-01-12 20:18

    Set the AutoSizeRowsMode to AllCells.

    0 讨论(0)
  • 2021-01-12 20:26

    Setting the Height property of each Row does work.

    foreach (DataGridViewRow row in dataGridView1.Rows)
    {
        row.Height = 80;
    }
    
    0 讨论(0)
  • 2021-01-12 20:30

    Two ideas:

    1) Set RowTemplate.Height before you bind the DGV

    2) Set AutoSizeRowsMode = none

    Either or both of these might help.

    0 讨论(0)
  • 2021-01-12 20:34

    AutoSizeRowsMode property change from none to AllCells or to any other value.

    0 讨论(0)
提交回复
热议问题