gridview header height

Post

Posted
Rating:
#1 (In Topic #195)
Regular
bill-lancaster is in the usergroup ‘Regular’
Is there a way to determine the height of the header in gridview?
Online now: No Back to the top

Post

Posted
Rating:
#2
Regular
bill-lancaster is in the usergroup ‘Regular’
I ask because, although the header height will usually be the same as row height, it possible for header height to be a multiple of row height.
Online now: No Back to the top

Post

Posted
Rating:
#3
Avatar
Guru
cogier is in the usergroup ‘Guru’
The only way I can find to set the header height is to set the font size.

<IMG src="http://cogier.com/gambas/Gridview%20header%20height.jpg"> </IMG>

Try the following code: -

Code (gambas)

  1. Public Sub Form_Open()
  2. Dim GridView1 As GridView
  3. Dim sText As String[] = ["Hello", "world!", "Charlie", "was", "here!"]
  4. Dim siCount, siLoop As Short
  5.  
  6.   .Width = 900
  7.   .Height = 200
  8.   .Padding = 5
  9.   .Arrangement = Arrange.Vertical
  10.   .Text = "Gridview header height"
  11.  
  12. GridView1 = New GridView(Me) As "GridView1"
  13.  
  14. With GridView1
  15.   .Expand = True
  16.   .Header = GridView.Horizontal
  17.   .Font.Size = 40
  18.   .Font.Bold = True
  19.   .Columns.Count = 5
  20.   .Rows.Count = 5
  21.  
  22. Print GridView1.Rows.height ''Is there a way to determine the height of the header in gridview?
  23.  
  24. For siCount = 0 To sText.Max
  25.   GridView1.Columns[siCount].Title = sText[siCount]
  26.   GridView1.Columns[siCount].Alignment = Align.Center
  27.  
  28. For siLoop = 0 To sText.Max
  29.   GridView1.Rows[siLoop].Height = 20
  30.   For siCount = 0 To sText.Max
  31.     GridView1[siLoop, siCount].Text = sText[siCount]
  32.     GridView1[siLoop, siCount].Font.Size = 12
  33.     GridView1[siLoop, siCount].Font.Bold = False
  34.   Next
  35.  

Is there a way to determine the height of the header in gridview?

If you add the following see line 25 above: -

Code (gambas)

  1. Print GridView1.Rows.height
Do this before you lower the height of the rows (line 33).
Online now: No Back to the top

Post

Posted
Rating:
#4
Regular
bill-lancaster is in the usergroup ‘Regular’
 That is amazing!
Thank you so much, I think this may be the only solution but such a complex solution to a simple matter
Regards
Online now: No Back to the top
1 guest and 0 members have just viewed this.