[Gambas-bugtracker] Bug #2105: GridView.Rows[Row].Height malfunction in GridView_Data sub

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Fri Feb 26 22:57:00 CET 2021


http://gambaswiki.org/bugtracker/edit?object=BUG.2105&from=L21haW4-

Comment #3 by Gianluigi GRADASCHI:

You could make GridView1.Rows.Height = -1 work as GridView1.Columns.Width = -1 works

For example the program code might work like this:

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 = 10000
  End With

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

Public Sub Form_Activate()

  GridView1.Rows.Height = -1
  
  '' instead of having a loop
  ' For r As Integer = 0 To GridView1.Rows.Max
  '   If GridView1[r, 0].WordWrap Then GridView1.Rows[r].Height = -1
  ' Next

End




More information about the Bugtracker mailing list