Sunday, January 11, 2015

Fix ASP.NET GridView Forms "thead" tag to support BootStrap 3

The problem on ASP.NET GridView control is that once it is rendered on a browser, it is automatically wrap by a "<div></div>"  tag and the header is on the tables "<tbody></tbody>"
which contradicts to BootStrap tables methodology of using "<thead></thead>".


To fix the problem. Apply or add this small script below. What it does is transfer the first element and create "<thead></thead>" tag automatically. I am not a jQuery expert so please forgive my code, hehehe. The very important one is to add the two classes on your gridView "grdViewTable" and "headerStyle

Jquery  Script

  Fixed Tag Image:

1 comment:

  1. How to play emperor casino | Shootercasino.com
    The most popular casino games are 제왕카지노 roulette, septcasino blackjack, and other popular games. Many variations of this game include baccarat, craps, roulette, and 메리트카지노

    ReplyDelete