How do I get the DataGrid ID that called the OnAttachScript?
Sub OnAttachScript( sender as Object, e as DataGridItemEve ntArgs)
if e.Item.ItemType = ListItemType.IT em Or _
e.Item.ItemType = ListItemType.Al ternatingItem then
Dim oImageButton as ImageButton =
CType(e.Item.Fi ndControl("Dele teButton"), ImageButton)
oImageButton.At tributes.Add ("onClick","Jav ascript:return confirm('Are
you sure you want to delete this item?');")
end if
end Sub
<asp:DataGrid
Visible=true
AllowSorting="f alse"
OnItemDataBound ="OnAttachScrip t"
AutoGenerateCol umns="false"
CellPadding="0"
CellSpacing="0"
ID="InProgressG rid"
....
Thanks,
Tom
Sub OnAttachScript( sender as Object, e as DataGridItemEve ntArgs)
if e.Item.ItemType = ListItemType.IT em Or _
e.Item.ItemType = ListItemType.Al ternatingItem then
Dim oImageButton as ImageButton =
CType(e.Item.Fi ndControl("Dele teButton"), ImageButton)
oImageButton.At tributes.Add ("onClick","Jav ascript:return confirm('Are
you sure you want to delete this item?');")
end if
end Sub
<asp:DataGrid
Visible=true
AllowSorting="f alse"
OnItemDataBound ="OnAttachScrip t"
AutoGenerateCol umns="false"
CellPadding="0"
CellSpacing="0"
ID="InProgressG rid"
....
Thanks,
Tom
Comment