Click here to Skip to main content
13,665,440 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I have this class Inherited from ColumnHeader

Public Class xcolumnheader

   Inherits ColumnHeader

   <Browsable(True), DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
   Public Property CP As New CollectionOfProperties

   Public Class CollectionOfProperties

       <Browsable(True)>
       Public Property Property1 As Boolean

       <Browsable(True)>
       Public Property Property2 As String

       <Browsable(True)>
       Public Property Property3 As Integer

   End Class

End Class


I want the CP property to be editable from the desinger (LIKE editing font of control)

What I have tried:

I tried searching but didn't find how do to it
Posted 12-Aug-18 5:15am
Updated 12-Aug-18 9:22am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

You only have to add the ExpandableObjectConverter as TypeConverter to your class :
Imports System.ComponentModel

Public Class xColumnHeader
    Inherits ColumnHeader

    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)>
    Public Property CP As New CollectionOfProperties

    <TypeConverter(GetType(ExpandableObjectConverter))>
    Public Class CollectionOfProperties

        Public Property Property1 As Boolean

        Public Property Property2 As String

        Public Property Property3 As Integer

    End Class

End Class


Additional :
You don't need the Browsable-Attribute at your Properties - each Property is normally allways 'browsable'. You only need this Attribute if you want that you Property is NOT browsable ...
  Permalink  
v2
Comments
Eng Ahmed Taha 5 days ago
   
It works … thank you
Ralf Meier 4 days ago
   
Afwan ... you're welcome ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01-2016 | 2.8.180810.1 | Last Updated 12 Aug 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100