I am trying to extend the GridView class to always show the header and footer, even when the data source is empty using the code I found online ( link ). However, the code is written in C #, but I use VB.
What is the next VB equivalent?
public event MustAddARowHandler MustAddARow;
Is there a way that VB.NET does not allow events to return a type?
Also, I cannot convert the following function due to 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 directly called. Use the expression "RaiseEvent" to raise an event.