We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

grid row height with RTB

Clay, You suggested the code below to allow the grid to show text with embedded tab characters. This works properly, however it often doesn''t make the row in the grid tall enough to show the last line. Is it possible for me to add a "fudge" factor to the computed height? This would make all notes a little (one line) taller, but would make the grid show the last line. Jim Frisby Dim rtb As New RichTextBox Private Sub GdbgWellNotes_DrawCellDisplayText(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs) Handles GdbgWellNotes.DrawCellDisplayText Dim gdbg1 As Syncfusion.Windows.Forms.Grid.GridDataBoundGrid gdbg1 = sender If (e.Style.CellIdentity.ColIndex = 4) Then ''//use for column 4 rtb.Clear() rtb.SelectedText = e.DisplayText Dim rtf As String = rtb.Rtf Syncfusion.Drawing.RichTextPaint.DrawRichText(e.Graphics, rtb, rtf, gdbg1.PrintingMode, gdbg1.GridBounds, e.TextRectangle, gdbg1.GridBounds, e.Style.BackColor, e.Style.WrapText, 100) e.Cancel = True End If End Sub

2 Replies

AD Administrator Syncfusion Team August 2, 2004 04:29 PM UTC

You can explicitly set a row height using me.grid.Model.RowHeights(someRowIndex) = 40 So if you are trying to call grid.Model.RowHeights.ResizeToFit somewhere, you could then afterwards explicitly reset the height of some rows, but I do not know of a good way to decide what rows need to be resized and by how much.


JA James A Frisby(For EPS - Computer Software) August 2, 2004 06:55 PM UTC

Thanks, that worked, seems like you only have to add 2 (whatevers) to the existing value to get it to consistently show the last line. Jim >You can explicitly set a row height using > >me.grid.Model.RowHeights(someRowIndex) = 40 > > >So if you are trying to call grid.Model.RowHeights.ResizeToFit somewhere, you could then afterwards explicitly reset the height of some rows, but I do not know of a good way to decide what rows need to be resized and by how much.

Loader.
Up arrow icon