开发者

how to increase rows size in DataGridView

开发者 https://www.devze.com 2023-03-18 17:23 出处:网络
How to increase rows size in DataGridView using C#? I can\'t find this property . Thanks 开发者_StackOverflowin advance.You can always loop through all DataGridViewRows and set the Height property:

How to increase rows size in DataGridView using C#? I can't find this property .

Thanks 开发者_StackOverflowin advance.


You can always loop through all DataGridViewRows and set the Height property:

foreach (DataGridViewRow row in dataGridView1.Rows) {
    if (heightShouldBeSet) {
        row.Height = yourHeightSetting;
    }
}


You need to add a new Row.

int n = dataGridView1.Rows.Add();

dataGridView1.Rows[n].Cells[0].Value = title;
dataGridView1.Rows[n].Cells[1].Value = dateTimeNow;


If you want to increase the row height you can also just contatenate empty line to the cell value.

0

精彩评论

暂无评论...
验证码 换一张
取 消