[Gambas-user] ColumnView Text in a second column

Gianluigi bagonergi at gmail.com
Tue Feb 22 23:21:39 CET 2022


Il giorno mar 22 feb 2022 alle ore 22:42 Mayost Sharon <sharon at 455.co.il>
ha scritto:

> Hello
>
> I have a control: ColumnView with 3 columns
> I add ITEM
> How do I set ITEM text to be in column 2 or 3 etc ...
>
> Thank you
>

Following is an old study project of mine, I hope it is helpful.
I don't know if it is correct because the ColumnView I never use it.
You can also see this discussion:
https://lists.gambas-basic.org/pipermail/user/2006-July/012927.html

Regards
Gianluigi

Private hColumnView As ColumnView

Public Sub Form_Open()

  Me.Arrangement = Arrange.Vertical
  Me.Margin = True
  With hColumnView = New ColumnView(Me) As "ColumnView1"
    .Expand = True
    .Columns.count = 4
    '.Header = False
    .Columns[0].Alignment = Align.Center
    .Columns[0].Title = "Nome"
    .Columns[1].Title = "Amici 1"
    .Columns[2].Title = "Amici 2"
    .Columns[3].Title = "In competizione con"
    .add("first", "Pippo", Picture["icon:/16/clock"])
    hColumnView["first"][1] = "Pluto"
    hColumnView["first"][2] = "Paperino"
    hColumnView["first"][3] = "Gastone"
    .add("second", "Topolino", Picture["icon:/16/group"])
    hColumnView["second"][1] = "Minnie"
    hColumnView["second"][2] = "Basettoni"
    hColumnView["second"][3] = "Gamba di legno"
    .Columns[1].Width = -1
    .Columns[2].Width = -1
    .Columns[3].Width = -1
  End With

End

Public Sub ColumnView1_Click()

  Dim hGrid As GridView = hColumnView.Children[0]

  Print "Colonna "; hGrid.Column
  Print "Chiave "; Quote(hColumnView.Current.Key)
  Print "Valore ";
Quote(hColumnView[hColumnView.Current.Key][hGrid.Column]); "\n"

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


More information about the User mailing list