We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,470 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Assign array to a StandardValuesCollection

Hi all,

How can I make the items in a standard values collection identical to the items contained in a previously defined (dynamic) array of strings?

Here's a snippet;

Public Class ElementList : Inherits StringConverter

        Public Overloads Overrides Function GetStandardValuesSupported(ByVal context As ITypeDescriptorContext) As Boolean
            Return True
        End Function

        Public Overloads Overrides Function GetStandardValues(ByVal context As ITypeDescriptorContext) As StandardValuesCollection

            Return New StandardValuesCollection(New String() {elList})
        End Function

        Public Overloads Overrides Function GetStandardValuesExclusive(ByVal context As ITypeDescriptorContext) As Boolean
            Return True
        End Function
    End Class

Here, elList is my shared array of strings, which has contents depending on the items in a listbox elsewhere on my form. So I want the items in the standard values collection to be equal to this listbox. The code doesn't work as it is, I assume I need to define some sort of delimiter in line 9?
The purpose of this is for a custom property grid which has a dropdown listbox as one of the properties. Thanks in advance!

1
Contributor
0
Replies
1
View
Question
Answered
raheel88
Newbie Poster
12 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Self-Answered as of 1 Year Ago

This question has already been solved: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0566 seconds using 2.67MB