Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何调整C1FlexGrid中的行高度?_Vb.net_Componentone_C1flexgrid - Fatal编程技术网

Vb.net 如何调整C1FlexGrid中的行高度?

Vb.net 如何调整C1FlexGrid中的行高度?,vb.net,componentone,c1flexgrid,Vb.net,Componentone,C1flexgrid,我需要在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 AutoSizeRo

我需要在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

请注意,AutoSizeRow方法在网格行中填充任何数据时有效。如果没有任何数据,AutoSizeRow将无法工作。同样的事情也发生在您的代码片段中。由于行中没有数据,fgrid.AutoResize(i)是无用的。尝试将代码段替换为以下内容,您将了解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