我得到了1行3列(日期,时间,什么)的表,我想在我的数据源中的3列(时间,什么)中的2我该怎么做?如何将数据绑定到数据源?
var table = (from r in socialEvents.AsEnumerable()
where r.Field<DateTime>("Date") >= Calendar1.SelectedDate.Date &&
r.Field<DateTime>("Date") <= Calendar1.SelectedDate.AddDays(1)
select r).CopyToDataTable();
if (table.Rows.Count > 0)
{
DataGrid1.Visible = true;
DataGrid1.DataSource = table;
DataGrid1.DataBind();
}
指定栏目,然后我看到5列(时间,内容,日期,时间,什么) – 2013-02-27 13:19:11
确保AutoGenerateColumns =“false” – happygilmore 2013-02-27 13:27:44