gridview 列标题从 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { GridView grid = sender as GridView; DataRowView tableData = e.Row.DataItem as DataRowView;
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[1].Text = System.DateTime.Now.AddMonths(-3).ToString("MMMM") ;
}
}
如何从后面的代码中对这一特定列进行排序。文件.asp
<asp:TemplateField ItemStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="Bottom" ItemStyle-Wrap="False">
<ItemTemplate>
<asp:Label ID="lblMonth_1" runat="server"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
谢谢。