Hello, I'm new to CSS and ASP.net and I've been trying to figure out how I can use CSS to show sorting arrows on the headers of my GridView control.
I've been able to get them to show on a sorted column, but I'd like them to show before the user sorts so that the user knows that they're sortable.
Here's what I have so far:
Set these GridView properties:
SortedAscendingHeaderStyle-CssClass="sortasc"
SortedDescendingHeaderStyle-CssClass="sortdesc"
And my css has this:
th.sortasc a
{
display:block; padding:0 4px 0 15px;
background:url("images/icons/ascArrow.png") no-repeat;
}
th.sortdesc a
{
display:block; padding:0 4px 0 15px;
background:url("images/icons/descArrow.png") no-repeat;
}
This works great to show an image after the user clicks a header and the column sorts.
But how can I have all columns show a sorting image before the sort, and then after the sort, have the sorted column show a different image?
Thanks for any help!
I've been able to get them to show on a sorted column, but I'd like them to show before the user sorts so that the user knows that they're sortable.
Here's what I have so far:
Set these GridView properties:
SortedAscendingHeaderStyle-CssClass="sortasc"
SortedDescendingHeaderStyle-CssClass="sortdesc"
And my css has this:
th.sortasc a
{
display:block; padding:0 4px 0 15px;
background:url("images/icons/ascArrow.png") no-repeat;
}
th.sortdesc a
{
display:block; padding:0 4px 0 15px;
background:url("images/icons/descArrow.png") no-repeat;
}
This works great to show an image after the user clicks a header and the column sorts.
But how can I have all columns show a sorting image before the sort, and then after the sort, have the sorted column show a different image?
Thanks for any help!