Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. need urgent help with bubbling events [modified]

need urgent help with bubbling events [modified]

Scheduled Pinned Locked Moved Visual Basic
help
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dove11
    wrote on last edited by
    #1

    I am having trouble with the EventHandler definition and the parameters to the routines. I have a datagrid with a template column. On that template column is a linkbutton. I want to simulate the click event of the linkbutton by bubbling events. It doesn't work. It goes through the code but the DataGrid onitemcommand event doesn't fire. Here's a code snippet. The DataGrid name is grdReceivingData, onitemcommand="ViewRecipientSubDetails", LinkButton commandname="view". At class level: Public Event Command As CommandEventHandler Sub, function, eventhandler definitions: For i As Integer = 0 To (grdReceivingData.Items.Count - 1) If grdReceivingData.Items(i).Cells(0).Text = DBASUB.ToString Then OnCommand(grdReceivingData.Items(i).Cells(4).Controls(1), New CommandEventArgs("view", String.Empty)) Exit For Else Exit Sub End If Next Protected Overridable Sub OnCommand(ByVal e As CommandEventArgs) Dim handler As CommandEventHandler = CType(MyBase.Events.Item("ViewRecipientSubDetails"), CommandEventHandler) If (Not handler Is Nothing) Then handler.Invoke(grdReceivingData.Items(0).Cells(4).Controls(1), e) End If MyBase.RaiseBubbleEvent(grdReceivingData.Items(0).Cells(4).Controls(1), e) End Sub Protected Overrides Function OnBubbleEvent(ByVal source As Object, _ ByVal e As EventArgs) As Boolean If TypeOf e Is CommandEventArgs Then Dim args As New DataGridCommandEventArgs(grdReceivingData.Items(0), _ grdReceivingData.Items(0).Cells(4).Controls(1), CType(e, CommandEventArgs)) MyBase.RaiseBubbleEvent(grdReceivingData, args) Return True End If Return False End Function Public Delegate Sub CommandEventHandler(ByVal sender As Object, ByVal e As DataGridCommandEventArgs) -- modified at 11:42 Tuesday 30th May, 2006

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups