【问题标题】:How to resize row height in C1FlexGrid?如何在 C1FlexGrid 中调整行高?
【发布时间】:2014-09-26 13:01:54
【问题描述】:
我需要在 C1FlexGrid 中自动调整行高。我需要使用 AutoSizeRow 让它工作,但它不会改变行高。我通过设置高度对其进行了测试,它可以工作。为什么 AutoSizeRow 不起作用?
For i As Integer = 0 To fgrid.Rows.Count - 1
'Setting the height explicitly changes the row height
fgrid.Rows(i).Height = 32
'But AutoSizeRow() does not change the row height
fgrid.AutoSizeRow(i)
Next i
【问题讨论】:
标签:
vb.net
componentone
c1flexgrid
【解决方案1】:
请注意,AutoSizeRow 方法在网格行中填充了任何数据时起作用。如果没有任何数据, AutoSizeRow 将根本无法工作。同样的事情也发生在你的 sn-p 身上。由于行中没有数据,所以 fgrid.AutoResize(i) 没用。尝试将您的 sn-p 替换为以下内容,您将了解 AutoSizeRow 的工作原理:
For i As Integer = 0 To fgrid.Rows.Count - 1
'Fill data in the cell
fgrid.Rows(i)(1) = "This is sample text"
'Setting the height explicitly changes the row height
fgrid.Rows(i).Height = 32
'AutoSizeRow() is changing the row height now
fgrid.AutoSizeRow(i)
Next i