日期:2014-05-17  浏览次数:20419 次

如何实现 gridview 某一个单元格中 动态添加 多个linkbutton????
我的的 gridview 的绑定 如下 代码

public void GV_SelectedBind()

    {
        
        GridView_SoftSelected.PageIndex = currentPageIndex;
        DataSet ds1 = new FixDevSoftSelectedMgr().GetList("SchemaID=" + Convert.ToInt32(((Label)DataList_Schema.Items[0].FindControl("lbl_SchemaID")).Text));
        string verid1 = "";
        DataTable dt = new DataTable();
        dt.Columns.Add(new DataColumn("DevStageID", typeof(string)));
        dt.Columns.Add(new DataColumn("SchemaID", typeof(string)));
        dt.Columns.Add(new DataColumn("VerID", typeof(string)));
        DataRow dr ;
        DataSet ds2 = CWorksNet.DBUtility.DbHelperSQL.Query("SELECT  * from Soft_DataDict where SuperValueID=5");
        for (int i = 0; i < ds2.Tables[0].Rows.Count; i++)
        {
            dr = dt.NewRow();
            dr[0] = ds2.Tables[0].Rows[i]["Value"].ToString();
            dr[1] = ((Label)DataList_Schema.Items[0].FindControl("lbl_SchemaID")).Text;

            for (int j = 0; j < ds1.Tables[0].Rows.Count; j++)
            {
                if (ds1.Tables[0].Rows[j]["DevStageID"].ToString() == ds2.Tables[0].Rows[i]["DictID"].ToString())
                {
                     // verid1 表示我最终 得到的要显示 在 gridview 某一单元格中的汉字 形如   小明,小红,小兰
                    verid1 = verid1 + CWorksNet.DBUtility.DbHelperSQL.GetSingle("select VerName from Soft_SoftVersion where VerID= "+ds1.Tables[0].Rows[j]["VerID"].ToString()) + ",";
                }
                
            }
            if(verid1.Length !=0)
            dr[2] = verid1.Substring(0,verid1.Length - 1);
            
            dt.Rows.Add(dr);
       &nb