VB.NET Abstract Property

Posted by ElPresidente on Stack Overflow See other posts from Stack Overflow or by ElPresidente
Published on 2013-11-01T15:47:05Z Indexed on 2013/11/01 15:53 UTC
Read the original article Hit count: 139

Filed under:

I have an abstract "GridBase" class with two types of derived classes "DetailGrid" and "HeaderGrid".

Respectively, one is comprised of "DetailRow" objects and the other "HeaderRow" objects. Both of those inherit from a "RowBase" abstract class.

What I am trying to do is the following:

Public MustInherit Class GridBase
    Private pRows As List(Of RowBase)

    Public ReadOnly Property Rows As List(Of RowBase)
        Get
            Return pRows
        End Get
    End Property
End Class

Public Class DetailGrid
    Inherits GridBase
End Class

In this scenario, I want DetailGrid.Rows to return a list of DetailRow. I want HeaderRow.Rows to return a list of HeaderRow. Am I on the right track with this or should the Rows property not be included in the GridBase class?

© Stack Overflow or respective owner

Related posts about vb.net