让DataGrid不激发验证
1
private void dgwfl_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
2
{
3
if(e.Item.ItemIndex>=0)
4
{
5
LinkButton lb = (LinkButton)e.Item.Cells[0].Controls[0];
6
lb.CausesValidation=false;
7
}
8![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
}
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
PS:Cells[0]为编辑所在的列,Controls[0]为该单元里的第一个控件.