1

我想要的是将事件添加到我在 VB.NET 中动态创建的 GridView 控件。这是我的代码。

Dim dgData as New GridView()
dgData.RowDataBound += New GridViewRowEvendHandler(dgData_RowDataBound)

每次我纠正上面的代码时,我都会在 dgData.RowDataBound 下得到蓝色的波浪线,原因如下:

"Public Event RowDataBound(etc...)是一个事件,不能直接调用。使用'RaiseEvent'语句引发事件”

如何摆脱蓝色的波浪线,以便将新的事件处理程序添加到此 RowDataBound?

4

1 回答 1

3

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.

于 2012-09-07T20:22:20.447 回答