gridview header height
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
gridview header height
Is there a way to determine the height of the header in gridview?
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: gridview header height
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.
- cogier
- Site Admin
- Posts: 1125
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: gridview header height
The only way I can find to set the header height is to set the font size.
Try the following code: -
Try the following code: -
Public Sub Form_Open()
Dim GridView1 As GridView
Dim sText As String[] = ["Hello", "world!", "Charlie", "was", "here!"]
Dim siCount, siLoop As Short
With Me
.Width = 900
.Height = 200
.Padding = 5
.Arrangement = Arrange.Vertical
.Text = "Gridview header height"
End With
GridView1 = New GridView(Me) As "GridView1"
With GridView1
.Expand = True
.Header = GridView.Horizontal
.Font.Size = 40
.Font.Bold = True
.Columns.Count = 5
.Rows.Count = 5
End With
Print GridView1.Rows.height ''Is there a way to determine the height of the header in gridview?
For siCount = 0 To sText.Max
GridView1.Columns[siCount].Title = sText[siCount]
GridView1.Columns[siCount].Alignment = Align.Center
Next
For siLoop = 0 To sText.Max
GridView1.Rows[siLoop].Height = 20
For siCount = 0 To sText.Max
GridView1[siLoop, siCount].Text = sText[siCount]
GridView1[siLoop, siCount].Font.Size = 12
GridView1[siLoop, siCount].Font.Bold = False
Next
Next
End
If you add the following see line 25 above: -Is there a way to determine the height of the header in gridview?
Print GridView1.Rows.height
Do this before you lower the height of the rows (line 33).-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: gridview header height
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
Thank you so much, I think this may be the only solution but such a complex solution to a simple matter
Regards