Columnwidth in Listview

petrbury

Member
Licensed User
Longtime User
Hi,
I have a problem with creating a listview table (using ListView.dll library). In AddColumn command I use ColumnWidth = -1 or -2 without expected effect. The Column is not sized in accordance with neither item nor header.
Source code is attached. Could somebody help me with it, please?
Thanks Petr
 

Attachments

  • ListViewTst.sbp
    949 bytes · Views: 197

specci48

Well-Known Member
Licensed User
Longtime User
I don't know what exactly causes the problem but:
If you use the values -1 or -2 during AddColumn, your table is not filled with any data yet. Maybe because of this the listview is not able to calculate a result for a suitable columnWith.

If you set the values -1 or -2 after filling the table with data everything works fine, e.g.:
B4X:
Sub FillLv
   Cell(0) = "123456"
   Cell(1) = "1234"
   Cell(2) = "123"
   Cell(3) = "12345"
   lv.AddRow(Cell())
   lv.ColWidthSet("Col1", -2)
   lv.ColWidthSet("Col2", -2)
   lv.ColWidthSet("Col4", -2)
   lv.ColWidthSet("Col4", -2)
End Sub

Could be a bug... or not...


specci48
 
Top