Wednesday, March 25, 2009

The magic of Dynamic Headers in a GridView

Very basic, but useful if you have a GridView with multiple views. I used this when I needed to Load a GridView with one set of information and then using an OnSelectedChange event show another set of info...all the while changing the HeaderText.

In your ASPX page don't declare a HeaderText field.

In your cs. file use this...(adjust column value to suit your GridView)
this.GridMyRequests.Columns[2].HeaderText = "Requestor";

No comments: