### Hide Table Header

To hide the TableView header, use the API Method "lookup" to obtain the TableHeader as a pane.
Reference: http://docs.oracle.com/javafx/2/api/javafx/scene/control/TableView.html.
The TableView header row is a pane. The pane properties PrefHeight and Visibility are set accordingly. See the comments in the sub below.
Example Sub TableView Header Hide / Unhide
`Sub HideHeaders(tv As TableView)
Dim joTable As JavaObject = tv
Dim header As Pane = joTable.RunMethod("lookup", Array As Object("TableHeaderRow"))
' If header is visible set visibility to false and height to 0 (else an empty row will be displayed)
If header.Visible = True Then
header.PrefHeight = 0
header.Visible = False
Else
' If header is not visible set visibility to true and height to -1 (which sets the best height according default tablerow settings)
header.PrefHeight = -1
header.Visible = True
End If
End Sub`
Important
The example sub must be called after a form is showed.
' Show the form which initializes the nodes
MainForm.Show
HideHeaders(TableView1)
Example usage on a tableview called tableviewStandard
`Sub buttonTest_Action
HideHeaders(tableviewStandard)
End Sub`

Changed: 2018-03-16 18:42, Category: TableView, File: T6C259M1890.htm, ID: 1890