标签:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
string FstWeekEnd,FstWeekEndday;
if (e.Row.RowType == DataControlRowType.Footer)
{
DropDownList ddl = (DropDownList)e.Row.FindControl("new_date");
for (int i = 0; i < 7; i++)
{
FstWeekEnd = DateTime.Now.AddDays(Convert.ToDouble((1 - Convert.ToInt16(DateTime.Now.DayOfWeek))) + 14 + i).ToString("yyyy-MM-dd");
FstWeekEndday = DateTime.Now.AddDays(Convert.ToDouble((1 - Convert.ToInt16(DateTime.Now.DayOfWeek))) + 14 + i).ToString("MM-dd");
ddl.Items.Add(new ListItem(FstWeekEndday, FstWeekEnd));
}
}
}
GridView Footer模板列中给Dropdownlist赋值
标签:
原文地址:http://www.cnblogs.com/pp521/p/4423388.html