如何在Gridview下拉列表中添加Checkbox

时间:2014-10-30 06:11:06

标签: c# asp.net sql-server

我需要在Gridview下拉列表中添加Checkbox,在RowDataBound事件中添加了下拉列表,它已从数据库中获取数据。

 protected void grdupload_OnRowDataBound(object sender, GridViewRowEventArgs e)
    {           
        List<string> coll = new List<string>();
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string fnCriteria = ((DataRowView)e.Row.DataItem)["fnCriteria"].ToString();               
            DropDownList ddlfnCriteria = (e.Row.FindControl("ddlfnCriteria") as DropDownList);
            coll.Add(fnCriteria);
            ddlfnCriteria.DataSource = coll.ToList();
            ddlfnCriteria.Text = fnCriteria;
            ddlfnCriteria.DataBind();                

        }
    }

请建议我找到解决方案。提前致谢