Scrollable Gridview with fixed headers in asp.net
horizontal and vertical scrollable Gridview with static headerrow.
fixed header in gridview in asp.net.
static header in gridview through java script.I was looking for a solution for this for a long time and found most of the answers are not working or not suitable for my situation i also find most of the java script code for that they worked but only with the vertical scroll not with the horizontal scroll and also combination of header and rows doesn’t match.
I wrote this article for the best solution and i tested it at all browser IE 7,IE 8 with compatibility and normal mode,Firefox,Opera etc.
- Copying Gridview into divHeaderRow show only header,hide all rowsand applying style to it so that divHeaderRow placed onto the top of the Gridview header row.
- If isFooter is true thenCopying Gridview Footer row into divFooterRow and applying style to divFooterRow.
Then Copy this code and paste and place your Grid View inside DivMainContent.
- ClientId of Gridview(Change GrdDisplay.ClientID as your gridview clientid)
- Height of Scrollable div
- Width of Scrollable div
- Height of Table Header Row
- IsFooter (true/false) If you want to Make footer static or not.