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