I need the header row of the gridview is fixed not to be scrollable. Many
people sugested to use CSS. It is too complicated to me. So, I try to get
every column's width to create a Label control to pretend the gridview's
herader.
The display of my gridview is fine. But I always get 0 as the column width.
Can any one give me a help with code to get width of column. Thank you.
My code is like:
Private adp As System.Data.OleDb.OleDbDataAdapter
adp = New System.Data.OleDb.OleDbDataAdapter()
Dim ds As DataSet = New DataSet()
:
:
adp.Fill(ds, "dataset")
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
Dim intC1Width As Int16 = GridView1.HeaderRow.Cells(1).Width.Value