初学DataGrid------使用DataGrid中删除某数据如何出现提示信息

来源:互联网 发布:js splice方法 w3c 编辑:程序博客网 时间:2024/05/29 09:19

 

 

DataGrid控件的ItemCreated事件中添如下代码,实现。

 

 

If (e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Or e.Item.ItemType = ListItemType.EditItem) Then
            Dim myCell As TableCell
            myCell = e.Item.Cells(e.Item.Cells.Count - 1)
            Dim btnDel As LinkButton = CType(myCell.Controls(0), LinkButton)
            btnDel.Attributes.Add("onclick", "return confirm('你真的要删除此行?');")

End If
 
  

原创粉丝点击