[Gambas-user] GridView Cell Height with WordWrap

Gianluigi bagonergi at gmail.com
Fri Feb 26 15:45:15 CET 2021


Il giorno ven 26 feb 2021 alle ore 11:32 Gianluigi <bagonergi at gmail.com> ha
scritto:

>
>
> Il giorno ven 26 feb 2021 alle ore 11:15 Rolf-Werner Eilert <
> rwe-sse at osnanet.de> ha scritto:
>
>> Am 26.02.21 um 00:07 schrieb Gianluigi:
>> > Hi Benoit,
>> > ...
>>
>>
>> Thank you so much, Gianluigi, that was it! It must not be within the
>> _Data event sub, but it has to be called separately after _Data has run.
>>
>> This way it runs flawlessly.
>>
>
> I'm glad you solved it, :-)
> but I think we need a more efficient way to operate otherwise we lose the
> advantage of using the Sub _Data.
> Assuming I understand how it works ;-)
>
>
I gave myself the answer without understanding it :-(
The thing is, it doesn't get much better [0]

Regards
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 = 1000
  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
    'If Column = 0 Then Try GridView1.Rows[Row].Height = -1
  Endif

End

Public Sub Form_Activate()

  For r As Integer = 0 To GridView1.Rows.Max
    If GridView1[r, 0].WordWrap Then GridView1.Rows[r].Height = -1
  Next

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


More information about the User mailing list