LISTVIEW里给DROPDLIST赋值

代码
protected void ListView1_DataBound(object sender, EventArgs e)
{



t_productCatTableAdapter aper
= new t_productCatTableAdapter();
gswz.DAL.DataSetProductCat.t_productCatDataTable productCat
= aper.GetData();
for (int i = 0; i < productCat.Count; i++)
{
Label lb1
= (Label)ListView1.FindControl("ctrl"+i+"$" + "Label1");
DropDownList dd1
= (DropDownList)ListView1.FindControl("ctrl1$" + "DropDownList1");
gswz.DAL.DataSetProductCat.t_productCatRow catrow
= productCat[i];

dd1.SelectedIndex
= Convert.ToInt32(catrow.Id);
// dd1.SelectedValue = Convert.ToString(catrow.name);

//dd1.SelectedValue = catrow.name;
}

//LISTVIEW里给DROPDLIST赋值

 

posted @ 2011-01-11 21:55  卢青松  阅读(287)  评论(0编辑  收藏  举报