Groups | Blog | Home
all groups > asp.net webcontrols > december 2005 >

asp.net webcontrols : Gridview Sorting


Matt
12/30/2005 6:01:05 AM
I have sorting enabled on a gridview which changes the header text to a
hyperlink. I need to specify the hyperlink style (color specifically). I
can't globally set the hyperlink style at the page level due to differing
requirements throughout the page. I can't figure out how to change this when
Phillip Williams
12/30/2005 9:50:02 AM
The CSS2 specification allows a syntax for descendants and child selectors
http://www.w3.org/TR/REC-CSS2/selector.html#descendant-selectors

So if one adds a HeaderStyle in the GridView markup:
<HeaderStyle cssClass=”GridViewHeader”/>
Then one can format the links in the header using the descendants selectors
like this:
<style>
..GridViewHeader a:link{/* style definition */}
..GridViewHeader a:hover{/*style definition */}
..GridViewHeader a:visited {/*style definition */}
</style>
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com


[quoted text, click to view]
AddThis Social Bookmark Button