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

    <FONT size=2>Hi</FONT>

    <FONT size=2>Just upgraded an application from .Net Spread for Windows 2.5 to version 4.</FONT>

    <FONT size=2>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.  </FONT>

    <FONT size=2>Can anyone assist?</FONT>

    <FONT size=2>Thanks,</FONT>

    <FONT size=2>JR</FONT>

    <FONT size=2>

    </FONT><FONT color=#0000ff size=2>Dim</FONT><FONT size=2> hdrRow </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer</FONT>

    <FONT color=#0000ff size=2>Dim</FONT><FONT size=2> hdrHeight, rowindx </FONT><FONT color=#0000ff size=2>As</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>Integer

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2>With</FONT><FONT size=2> grd.ActiveSheet

    .ColumnHeaderRowCount = 5

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

    </FONT><FONT color=#0000ff size=2>For</FONT><FONT size=2> rowindx = 0 </FONT><FONT color=#0000ff size=2>To</FONT><FONT size=2> 4

    </FONT><FONT color=#0000ff size=2>   If</FONT><FONT size=2> rowindx <> 3 </FONT><FONT color=#0000ff size=2>Then

    </FONT><FONT size=2>

           .ColumnHeader.Cells(rowindx, 0).Text = </FONT><FONT color=#a31515 size=2>"Header"</FONT><FONT size=2> + rowindx.ToString

    </FONT><FONT color=#0000ff size=2>   End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>If

    </FONT><FONT size=2>

       .Cells(rowindx, 0).Text = </FONT><FONT color=#a31515 size=2>"Row"</FONT><FONT size=2> + rowindx.ToString

    </FONT><FONT color=#0000ff size=2>Next

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2>For</FONT><FONT size=2> hdrRow = 0 </FONT><FONT color=#0000ff size=2>To</FONT><FONT size=2> 4

       hdrHeight = .ColumnHeader.Rows(hdrRow).GetPreferredHeight

      .ColumnHeader.Rows(hdrRow).Height = hdrHeight </FONT><FONT color=#008000 size=2>'If 0, seems to hide matching row of the grid as well?

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2>Next

    </FONT><FONT size=2>

    </FONT><FONT color=#0000ff size=2>End</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>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