我有一个模板列,我在里面放两个控件(ItemTemplete)第一个控件能帮定上数据,第二个就帮定不上!我的代码!
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
((LinkButton)(this.DataGrid1.Items[i].Cells[0].Controls[1])).Text = ds.Tables[0].Rows[i][1].ToString();
((LinkButton)(this.DataGrid1.Items[i].Cells[0].Controls[1])).CommandName = ds.Tables[0].Rows[i][0].ToString();
((Label)(this.DataGrid1.Items[i].Cells[0].Controls[1])).Text = ds.Tables[0].Rows[i][2].ToString();
}
请高人指点!
for(int i=0;i<ds.Tables[0].Rows.Count;i++)
{
((LinkButton)(this.DataGrid1.Items[i].Cells[0].Controls[1])).Text = ds.Tables[0].Rows[i][1].ToString();
((LinkButton)(this.DataGrid1.Items[i].Cells[0].Controls[1])).CommandName = ds.Tables[0].Rows[i][0].ToString();
((Label)(this.DataGrid1.Items[i].Cells[0].Controls[1])).Text = ds.Tables[0].Rows[i][2].ToString();
}
请高人指点!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货