Private myName As String
Private myTicker As String
Public Sub New(newName As String, newTicker As String)
Me.myName = newName
Me.myTicker = newTicker
End Sub
Public ReadOnly Property Name() As String
Get
Return myName
End Get
End Property
Public ReadOnly Property Ticker() As String
Get
Return myTicker
End Get
End Property
End Class
Sub DataGrid_ItemCreated(Sender As Object, e As DataGridItemEventArgs)
Select Case e.Item.ItemType
Case ListItemType.Item
Dim myDeleteButton As Button
myDeleteButton = e.Item.FindControl("btnDelete")
myDeleteButton.Attributes.Add("onclick","return confirm('Are you Sure you want to delete this company?');")
Case ListItemType.AlternatingItem
Dim myDeleteButton As Button
myDeleteButton = e.Item.FindControl("btnDelete")
myDeleteButton.Attributes.Add("onclick","return confirm('Are you Sure you want to delete this company?');")
End Select
End Sub
Sub DataGrid_DeleteRow(sender As Object, e As EventArgs)
Label1.Text = "HEY, you can't delete that company!"
End Sub