1.这个问题我没用过。
2。动态加,在DataGrid_ItemCreated事件里,
if(e.Item.ItemType=="Footer")
{
添加控件。
}

解决方案 »

  1.   

    可以使用JavaScript验证
    script language="javascript">
    function delete_confirm(e) {
    //如果“删除...”是链接则用(event.srcElement.outerText == "删除...")
    //如果“删除...”是按钮则用(event.srcElement.value == "删除...")
    if (event.srcElement.outerText == "删除")
    event.returnValue =confirm("您确认要删除吗?");
    }
    document.onclick=delete_confirm;
    </script>
    在页脚里加一个<TemplateItem>
      

  2.   

    嗯,可以,关键是e.Item.ItemType.ToString()=="Footer"
    谢,待会结贴
      

  3.   

    kentis(小张)同志好像没理解我的意思,问题不是怎么添加删除验证弹出框,而是编辑时如何添加验证控件例如RequiredFieldValidator伍的
      

  4.   

    gshope(北京.Net)还在么,有问题——
    我添加页脚控件时,添加验证控件时出错,
    代码如下:
    TextBox NewFieldCode=new TextBox();
    RequiredFieldValidator R1=new RequiredFieldValidator();
    R1.ControlToValidate="NewFieldCode";
    提示如下:
    Unable to find control id 'NewFieldCode' referenced by the 'ControlToValidate' property of ''.
    好像ControlToValidate这个属性不能指向动态创建的控件似的
    怎么办捏?
      

  5.   

    参考:
    http://www.ccw.com.cn/htm/center/prog/02_2_26_4.asp
      

  6.   

    这个文章看了,还是不知所以然
    <asp:templatecolumn> 
    <itemtemplate> 
    <%# Container.DataItem("Age") %> 
    </itemtemplate> 
    <edititemtemplate> 
    <asp:RegularExpressionValidator runat="server" ControlToValidate="txtAge" ErrorMessage="Invalid input for Age" 
    ValidationExpression="[0-9]{2}" /><br> 
    <asp:textbox runat="server" id="txtAge" value='<%# Container.DataItem("Age") %>' /> 
    </edititemtemplate> 
    </asp:templatecolumn> 
    那个itemtemplate和edititemtemplate是什么关系,是不是这样设置之后,显示是age,进入编辑状态后,就自动显示Textbox啊
      

  7.   

    .NET的验证控件非常难用的。如果使用JS可能会好一些
      

  8.   

    放在Footer里的控件是不能直接访问的,
    在DataGrid_ItemCreated事件里,
    if(e.Item.ItemType=="Footer")
    {
    TextBox te=new TextBox();
    te=e.Item.FindControl("TextBox名称");
    把te 加到验证控件里....
    }
      

  9.   

    谢谢北京.net
    楼上,你给的那个文章我没看懂,不过在那里我搜到另外一篇,有点收获
    关键吖,是我找到模板列编辑界面了
    .net的datagrid没有可视化界面实在看起来很@_@~~~
    结贴散分,两位大侠五五开吧