I'm trying to extend the GridView class to always show the header and footer even when the datasource is empty by using the code I found online (link). However, the code is written in C# but I use VB.
What is the VB equivalent of the following?
public event MustAddARowHandler MustAddARow;
Is there a way around VB.NET not allowing events to return a type?
Also, I cannot convert the following function because of the error below.
Code:
Protected Function OnMustAddARow(ByVal data As IEnumerable) As IEnumerable
If MustAddARow = Nothing Then 'Error on MustAddARow'
Throw New NullReferenceException("The datasource has no rows. You " _
& "must handle the 'MustAddARow' Event.")
End If
Return MustAddARow(data) 'Error on MustAddARow'
End Function
Error: Public Event MustAddARow(data As System.Collections.IEnumerable)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.