Reputation: 275
What I want is do add events to my dynamically created GridView controls in VB.NET. Here is my code.
Dim dgData as New GridView()
dgData.RowDataBound += New GridViewRowEvendHandler(dgData_RowDataBound)
Every time I right the code above I get the blue squiggle line under dgData.RowDataBound and here is the reason:
"Public Event RowDataBound(etc...)
is an event, and cannot be called directly. Use a 'RaiseEvent'
statement to raise an event"
How can I get rid of the blue squiggle line so I can add my new event handler to this RowDataBound?
Upvotes: 1
Views: 3437
Reputation: 1775
Could this be what your looking for? https://stackoverflow.com/a/687293/614263
You need to review Events in VB. It looks like your trying to use C# syntax there.
Upvotes: 3