OnAttachScript DataGrid ID

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    #1

    OnAttachScript DataGrid ID

    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


  • tshad

    #2
    Re: OnAttachScript DataGrid ID

    Actually, it is the OnItemDataBound event.

    Thanks,

    Tom
    "tshad" <tscheiderich@f tsolutions.comw rote in message
    news:u5h$lY4rGH A.4452@TK2MSFTN GP05.phx.gbl...
    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
    >

    Comment

    Working...