Problem with buttons in a gridview with frozen headers [modified]
-
I have a gridview with Select buttons in the first column. There are lots of rows, and I have set up CSS to freeze the header row in place as the table is scrolled (using position:relative). I also have CSS set up for the hover event of the button which highlights the button with a nice black border. The problem arises when the containing div is scrolled. If the cursor is moved over any one of the buttons, the header row suddenly jumps to it's scrolled position (a lot of the time this is too far north and it just disappears). Scroll back to the top of the grid, and hover again - it's back! Any diagnoses and possible cures greatly appreciated. p.s. Yes I have considered creating a custom control inheriting from Gridview, but this seems like a lot of work when the solution I currently have is so close to perfect...
modified on Wednesday, February 06, 2008 6:13:54 AM
-
I have a gridview with Select buttons in the first column. There are lots of rows, and I have set up CSS to freeze the header row in place as the table is scrolled (using position:relative). I also have CSS set up for the hover event of the button which highlights the button with a nice black border. The problem arises when the containing div is scrolled. If the cursor is moved over any one of the buttons, the header row suddenly jumps to it's scrolled position (a lot of the time this is too far north and it just disappears). Scroll back to the top of the grid, and hover again - it's back! Any diagnoses and possible cures greatly appreciated. p.s. Yes I have considered creating a custom control inheriting from Gridview, but this seems like a lot of work when the solution I currently have is so close to perfect...
modified on Wednesday, February 06, 2008 6:13:54 AM
I got around this problem for the prototype demo by not having enough data to require scrolling! For the production version I will probably create a custom gridview inheriting from Gridview, or dolly up a Repeater with some sorting capabilities. However, I'm still curious as to what would cause this. I assume it's client side (IE only - not tried in FF) as I don't see any postback or page refresh. Any thoughts?