我的工作,有一个datagridview
和propertygrid
一个小应用程序。与PropertyGrid中隐藏重复结合datagridview的值
在本申请中,主要对象class
和几个来自主类的derived classes
。
因此,例如,可以让呼叫
MainClass
和DerivedClass
的datagridview
绑定到BindingList(Of MainClass)
和当用户选择的小区或行的propertygird
应显示DerivedClass
properties
我可以能做到这一点,但因为我的MainClass
具有性质也可在DerivedClass
我有重复的值,因为我只想送即仅在DerivedClass
中提供的属性。
我该如何做到这一点?
的解决方案可能是这个post,但可悲的是C#是总胡言乱语,我(我不是一个有经验的程序员。)这样做是使用
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
如果你有答案已经,为什么不尝试将其转换,然后再与您遇到任何事后的问题回来? –
它只是创建自定义属性,并使用它来控制哪些道具经由[PropertyGrid.BrowsableAttributes](https://msdn.microsoft.com/query/dev11.query?appId=Dev11IDEF1&l=EN-US&k=k显示(System.Windows.Forms.PropertyGrid.BrowsableAttributes); K(TargetFrameworkMoniker-.NETFramework,版本%3Dv4.5.1); K(DevLang-VB)RD =真) – Plutonix