ColumnHeader.rows.GetPreferredHeight modifying row height in grid?

Posted by: jeanr on 8 September 2017, 1:13 pm EST

  • Posted 8 September 2017, 1:13 pm EST

    Hi


    Just upgraded an application from .Net Spread for Windows 2.5 to version 4.


    I set the header row height using GetPreferredHeight.  If the preferred height is 0, the header row is hidden, but the matching row on the grid is also hidden.  Below is an example which populates the header text and cells, numbering each from 0 to 4.  Header row 3 has no description, and when the height is set to0, row 3 on the grid is hidden as well. 


    Can anyone assist?


    Thanks,


    JR


    Dim hdrRow As Integer


    Dim hdrHeight, rowindx As Integer


    With grd.ActiveSheet


    .ColumnHeaderRowCount = 5


    .ColumnHeader.AutoText = FarPoint.Win.Spread.HeaderAutoText.Blank


    For rowindx = 0 To 4


       If rowindx <> 3 Then


           .ColumnHeader.Cells(rowindx, 0).Text = "Header" + rowindx.ToString


       End If


       .Cells(rowindx, 0).Text = "Row" + rowindx.ToString


    Next


    For hdrRow = 0 To 4


       hdrHeight = .ColumnHeader.Rows(hdrRow).GetPreferredHeight


      .ColumnHeader.Rows(hdrRow).Height = hdrHeight 'If 0, seems to hide matching row of the grid as well?


    Next


    End With

  • Replied 8 September 2017, 1:13 pm EST

    Jean -

    This was a bug in the version you are using.  I tested it with the internal build we are going to be releasing soon as a maintenance release and it is fixed in that.
  • Replied 8 September 2017, 1:13 pm EST

    Thank you.  Look forward to the maintenance release.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels