[Gambas-user] GridView Cell Height with WordWrap

Gianluigi bagonergi at gmail.com
Fri Feb 26 00:07:44 CET 2021


Hi Benoit,

over to:
GridView[0, 0].WordWrap = True
GridView[0, 0].Text = "A really long text"
GridView.Rows[0].Height = -1
you have created"GridView.Data.WordWrap = True" but there seems to be no
quick way to adjust the row height.
GridView.Rows[Row].Height = -1 within the Sub _Data fails.
It is I who did not understand or, using the Sub _Data, the only way is
this [0].
It would be much simpler and faster if GridView.Rows.Count started the Sub
_Data so that you could enter a command after processing all the rows.

Regards and Good night
Gianluigi

[0]
Private $sText1 As String = "Nel mezzo del cammin di nostra vita mi
ritrovai in una selva oscura"
Private $sText2 As String = "Pippo"

Public Sub Form_Open()

  With GridView1
    .Header = 3
    .Columns.Count = 2
    .Columns.Width = 100
    .Rows.Count = 100
  End With
  For r As Integer = 0 To GridView1.Rows.Max
    For c As Integer = 0 To GridView1.Columns.Max
      If GridView1[r, c].WordWrap Then GridView1.Rows[r].Height = -1
    Next
  Next

End

Public Sub GridView1_Data(Row As Integer, Column As Integer)

  If Row Mod 2 = 0 Then
    GridView1.Data.Text = $sText2
    GridView1.Data.Background = &HBFFFBF
  Else
    GridView1.Data.WordWrap = True
    GridView1.Data.Text = $sText1
  Endif

End
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210226/1d31b466/attachment.htm>


More information about the User mailing list