ASP.NET - Determining the detailsview title column width at runtime
Posted on 2010-11-12
I have a DetailsView object which pulls its data from a sqldatasource. At runtime, based on the data retrieved, the page will hide some rows and show others of the DetailsView object.
Because of the hiding/showing of rows is based on data, the column width of the title column changes at runtime. I need to be able to determine programatically what the column size is in pixels.
This doesn't work, but I'm thinking something like this:
Dim intWidth as integer = dvResults.Rows(0).Cells(0).Width.Value
Dim intWidth As Integer = dvResults.HeaderStyle.Width.Value