public static void AddSortingArrow(GridView gv, GridViewRowEventArgs e)
{
if (e.Row.RowType != DataControlRowType.Header)
return;
foreach (TableCell tc in e.Row.Cells)
{
if (tc.HasControls())
{
LinkButton lnk = (LinkButton)tc.Controls[0];
if (lnk != null)
{
Label lbl = new Label();
lbl.Text = (gv.SortDirection == SortDirection.Ascending ? "▲" : "▼");
if (gv.SortExpression == lnk.CommandArgument)
{
lbl.Text = " " + lbl.Text;
tc.Controls.Add(lbl);
}
}
}
}
}
Visual Studio 插件推介–metalscroll
14 years ago
