protected void gvSorting_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
foreach (TableCell cell in e.Row.Cells)
{
LinkButton lbSorting = (LinkButton)cell.Controls[0] as LinkButton ;
Image sortImage = new Image();
if (lbSorting.Text == gvSorting.SortExpression)
{
if (gvSorting.SortDirection == SortDirection.Ascending)
{
sortImage.ImageUrl = "Images/asc.gif";
sortImage.ToolTip = "Ascending Order";
}
else
{
sortImage.ImageUrl = "Images/desc.gif";
sortImage.ToolTip = "Descending Order";
}
cell.Controls.Add(sortImage);
}
}
}
}