使用 rowtemplate 更改 datagridview 行高但不起作用

发布于 2024-11-30 23:12:51 字数 305 浏览 7 评论 0原文

我有一个 DataGridView ,其中有两列成员名称和成员图像。

我想增加 DataGridView 中每行的高度。

我设置了属性的值,但高度没有改变,我也检查了下面提到的任何其他属性。

我已经尝试过这样的更改,但无论如何它都不会改变 DataGridView 行高...

var dgv = new DataGridView();
dgv.RowTemplate.Height = 30;

任何人都可以帮忙解决这个问题吗?

I have a DataGridView with two columns member name and member image.

I want to increase the height of each row in the DataGridView.

I set the value for the property but height doesn't change, any other property also I have checked I mentioned below.

I have tried like this for changing but any way it does not change the DataGridView row height...

var dgv = new DataGridView();
dgv.RowTemplate.Height = 30;

can anyone help on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

缪败 2024-12-07 23:12:51

设置 dgv.RowTemplate.Height 值后绑定数据或设置 gridview 数据源,如果数据已加载到网格,则重新绑定数据设置上述属性。

Bind data or set gridview datasource after setting the dgv.RowTemplate.Height value, if already data loaded to grid rebind data ones setting above property.

岁月流歌 2024-12-07 23:12:51

我想增加每行的高度

如果在设计时:

在 DataGridView 的属性中,找到 RowTemplate 属性;

单击RowTemplate右侧的箭头,显示更多详细信息;

编辑高度属性。

I want to increase the height of each row

At design time or programmatically?

If at design time:

In the properties for the DataGridView, find the RowTemplate property;

click the arrow on the right of RowTemplate, reveailng more details;

edit the Height property.

素罗衫 2024-12-07 23:12:51

请在加载数据源之前加载 RowTemplate.Heigh
前任:
dataGridView1.RowTemplate.Height = 32;
dataGridView1.DataSource = 表;

Please load RowTemplate.Heigh before loading DataSource
ex:
dataGridView1.RowTemplate.Height = 32;
dataGridView1.DataSource = Table;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文