Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to create an Items property

$
0
0

Hi

I'm creating a custom datagridviewcolumn and need to create a property Items, just like the Items property of the DataGridViewComboBoxColumn.

I tried the following declaration

Private It As DataGridViewComboBoxCell.ObjectCollection<DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
        Public Property Items As DataGridViewComboBoxCell.ObjectCollection
            Get
                Return It
            End Get
            Set(value As DataGridViewComboBoxCell.ObjectCollection)
                It = value
            End Set
        End Property

but when i access datagrid's column's property, it shows a different editor, in fact, i can't assign values to the list.

I tried then to declare the property as String() and it appears correct, unless that i lost access to the methods of the collection. Tried too as IList(Of String) and ICollection(Of String) but it behaves like the first try.

I'd appreciate any help that you could give.

Thanks in advance 


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>