注册 登录
编程论坛 ASP.NET技术论坛

ItemDataBound又有问题了

yunj1105 发布于 2007-05-21 13:14, 799 次点击

不好意思呀,我又有问题了
ItemDataBound是这么写吗?protected void datagrid_ItemDataBound(object sender, EventArgs e)
我双击,出不来这个函数
这样写报错了:System.EventArgs”并不包含“Item”的定义
我的程序是这么写的
protected void datagrid_ItemDataBound(object sender, EventArgs e)
{
foreach (DataGridItem Item in DataGrid1.Items)
{
string str_date = "select * from lab_date";
DropDownList dropdownlist = (DropDownList)e.Item.Cells[3].FindControl("drp");
co_cla.dr_Bind(str_date, dropdownlist);
dropdownlist.DataBind();
DropDownList dropdownlist1 = (DropDownList)e.Item.Cells[4].FindControl("drp1");
co_cla.dr_Bind(str_date, dropdownlist1);
dropdownlist1.DataBind();
}
}

4 回复
#2
bygg2007-05-21 15:11
co_cla].FindControl("drp");
#3
sdlklhd2007-05-21 15:12

private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)

记得参数e应该是ListItem类型的.

#4
yunj11052007-05-21 17:01

呵呵 谢谢大家啊

#5
sdlklhd2007-05-23 07:55
互相学习
1