AutoFit Row Height

Posted by: srvjith on 8 September 2017, 12:27 pm EST

  • Posted 8 September 2017, 12:27 pm EST

    Hi,


    I want to set the height of Row like MS Excel does - AutoFit Row Height.


    The height of the row should change according to the contents of Row on Double clicking the border of row header. 


    How does FarPoint support this?


     


    Regards,


    Sar

  • Replied 8 September 2017, 12:27 pm EST

    We support this for columns but at this time not for rows.  You can double-click in a row header and use the CellDoubleClick event and check to see if you are clicking in the header and if so use the
    GetPrefferedRowHeight method to set the height for the row.
  • Replied 8 September 2017, 12:27 pm EST

    Sar -

    There is no event that will return when you click on the border.
  • Replied 8 September 2017, 12:27 pm EST

    I also have a requirement, where I need to show the width of column or height of row, while the user is expanding the column width or row heigh on the sheet.


    Do you expose any events to track the width or height increasing?


     


    If not is it possible to add this as a future capability?


     

  • Replied 8 September 2017, 12:27 pm EST

    There is the ColumnWidthChanged and RowHeightChanged events but they only fire when the resizing is finished.
  • Replied 8 September 2017, 12:27 pm EST

    I have used those events and they have been usefull.  But I also want events while the width or height is changing.  Can this be provided in the future version?

  • Replied 8 September 2017, 12:27 pm EST

    Hi Sar,

    Code example of how to do this: 
        Private Sub FpSpread1_CellDoubleClick(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.CellClickEventArgs) Handles FpSpread1.CellDoubleClick
    If e.RowHeader = True Then
    Dim
    size As Single
    size = FpSpread1.Sheets(0).Rows(e.Row).GetPreferredHeight()
    FpSpread1.Sheets(0).Rows(e.Row).Height = size
    End If
    End Sub
     
  • Replied 8 September 2017, 12:27 pm EST

    Yes. This works.  But what I have to do is to click on the border (where the cursor changes to to Cross) and not in the cell.  When I double click at the Border, I am not getting any event.


     


    I want to achieve the same functioanlity as with column sizing.   Which event should I subscribe to listen to changes on the border of header cells?


     

  • Replied 8 September 2017, 12:27 pm EST

    I will add these as enhancements for a future version.
Need extra support?

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

Learn More

Forum Channels