[Gambas-user] GridView.ClientWidth yields incorrect size on Form_Open

T Lee Davidson t.lee.davidson at gmail.com
Fri Feb 1 18:04:59 CET 2019


On 2/1/19 10:30 AM, Benoît Minisini wrote:
> Another way is setting the column width to "-1" or setting the column Expand property to TRUE.

I totally missed that a GridView_Column has an Expand property. But, it does not seem to work. Am I using it incorrectly?

Public Sub Form_Open()

   Dim Headers As String[] = ["0123456789", "0123456789", "0123456789", "0123456789"]

   With GridView1
     .AutoResize = False
     .Header = GridView.Horizontal
   End With

   GridView1.Rows.Count = 1
   GridView1.Columns.Count = Headers.Count
   GridView1.Columns[0].Expand = True
   For i As Integer = 0 To Headers.Max
     GridView1.Columns[i].Title = Headers[i]
     GridView1[0, i].Text = String(30, "*")
   Next

End


Also, while we are talking about column widths, the GridView_ColumnResize and GridView_ColumnSize events appear to be identical. 
Is there a difference in behavior and use cases?


___
Lee



More information about the User mailing list