ASP.Net - ListView - Hiding a Column
Occasionally, I’ll have a column on the listview that I want hidden.
Here is an example where I am hiding a column if the mode attribute of a viewstate is ‘unpaid’.
2 events are involved:
- PreRender - to hide columns in the header
- Item Databound - to hide columns from rows being displayed.
1 | Protected Sub lv_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles lv.PreRender |