使用 rowtemplate 更改 datagridview 行高但不起作用
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
设置 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.?
如果在设计时:
在 DataGridView 的属性中,找到 RowTemplate 属性;
单击RowTemplate右侧的箭头,显示更多详细信息;
编辑高度属性。
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.
请在加载数据源之前加载 RowTemplate.Heigh
前任:
dataGridView1.RowTemplate.Height = 32;
dataGridView1.DataSource = 表;
Please load RowTemplate.Heigh before loading DataSource
ex:
dataGridView1.RowTemplate.Height = 32;
dataGridView1.DataSource = Table;