thead for Asp.Net GridView

Recently I had the requirement to provide the functionality of drag and drop rows and decided to use one of the jQuery plugins to aid in doing that. One thing I had noticed though is that these plugins require that your gridview be rendered out using ‘thead’ for the header row and ‘tbody’ for the content rows.

By default the gridview does not do this, however, you can force it to do so using this bit of code:

gridview1.HeaderRow.TableSection = TableRowSection.TableHeader;

The above code renders the grid using the required thead and tbody tags.

Leave a comment

Your comment