[Gambas-user] GridView Row Height

T Lee Davidson t.lee.davidson at gmail.com
Tue Feb 16 19:21:16 CET 2021


On 2/15/21 1:11 PM, KKing wrote:
>> gridview1.header = 3
> 
> Thankyou @Gianluigi that works ... even if I prefer
>        GridView1.Header = GridView.Both
> 
> Would be cool if GridView worked like excel/calc where clicking the top left of the grid view auto selects all rows and columns 
> and adjusting the row height of one row adjusts every row to the new height. Something to look at another day.

I could be wrong, but I believe columns cannot be selected. Just select all rows. For example:
[code]
Public Sub GridView1_DblClick()

   If Mouse.X < 20 And If Mouse.Y < 28 Then GridView1.SelectAll

End
[/code]

You can accomplish an auto-adjust of all row heights using the RowResize event. (RowSize apparently does not get triggered; nor 
does ColumnSize BTW.) Unfortunately, the RowResize event gets triggered multiple times during a resize. So, you'll have to 
combine it with a semaphore (that also stores the row number) and the MouseUp event. For example:
[code]
Public ResizedRow As Integer = -1

Public Sub GridView1_RowResize(Row As Integer)

   ResizedRow = Row

End

Public Sub GridView1_MouseUp()

   If ResizedRow < 0 Then Return
   For x As Integer = 0 To GridView1.Rows.Max
     GridView1.Rows[x].Height = GridView1.Rows[ResizedRow].Height
   Next
   ResizedRow = -1

End
[/code]


-- 
Lee


More information about the User mailing list