LISTVIEW里给DROPDLIST赋值

作者:互联网   出处:控件中国网   2014-11-05 19:04:58   阅读:1

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赋值

Copyright© 2006-2015 ComponentCN.com all rights reserved.重庆磐岩科技有限公司(控件中国网) 版权所有 渝ICP备12000264号 法律顾问:元炳律师事务所
客服软件
live chat