简体   繁体   English

如何在C#.net中的运行时在datagrid中调整行高?

[英]How to adjust row height in datagrid at runtime in C# .net?

如何在C#.net中的运行时在datagrid中调整行高?

Loop through the rows and change it, for example: 循环浏览并更改行,例如:

foreach (DataGridViewRow row in dataGridView1.Rows)
{
    row.Height -= 2;
}

other than loop this event can be used for setting row height in WPF grid. 除了循环外,此事件可用于在WPF网格中设置行高。

private void dataGrid1_LoadingRow(object sender, DataGridRowEventArgs e) 私有void dataGrid1_LoadingRow(对象发送者,DataGridRowEventArgs e)

    {
        e.Row.Height = 100.00;
    }

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

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