请问楼主用的是什么方法动态生成的模板列?
你的这个问题现在解决了么?
我用
ITemplate temp1= Page.LoadTemplate("webusercontrol1.ascx");//我还给这个自定义的控件起了个ID叫“UC1”。里面只有一个CheckBox1的东东。
TemplateColumn tc=new TemplateColumn();
tc.HeaderText = "dddd";
tc.ItemTemplate = temp1;
DataGrid1.Columns.Add(tc);
用楼上几位老大的方法,都不成功。help。。

解决方案 »

  1.   

    TextBox txt
    if (yourGrid.Items.count>=1)
    {
        for (int i=0;i<yourGrid.items.count;i++)
        {
            txt=((TextBox)yourGrid.Items[i].FindControl("youTextBoxID")).text
        }
    }
    如果你的Grid是用数据绑定,
    在Private void Page_load(object sender, System.EventArgs e)中
    {
    if (!Page.IsPostBack)
      {
        BindGrid();
       }
    }
      

  2.   

    楼上的意见可以参考的!
    其实关键是根据你的代码,在绑定显示后,确定你的动态模板列的位置与id就ok了!!