I'm working on a small application that has a datagridview
and propertygrid
.
In this application there is a main object class
and several derived classes
from the main class.
So for example lets call the
MainClass
andDerivedClass
The datagridview
is bound to a BindingList(Of MainClass)
and when the user selects a cell or row the propertygird
should display the DerivedClass
properties
I can manage to do this, but because my MainClass
has properties that are also available in the DerivedClass
I have duplicate values, as I would only like to see the properties that are ONLY available in the DerivedClass
.
How can I achieve this?
The solution could be this post, but sadly c# is total gibberish for me (I am not an experienced programmer..)
Public Class MainClass
Public Property ComponentType As BodyComponentTypeEnum
Public Enum BodyComponentTypeEnum
Cylinder
End Enum
Public Property Height As Double
Public Property Thickness As Double
Public Property Material As String
Public Property Diameter As Double
Public Property Mass As Double
End Class
Public Class DerivedClass
Inherits MainClass
Public Property Segments As Integer
Public Property WeldOrientation As Double
End Class