We are using the .NET PropertGrid to edit the Usersettings of our application. If we use Strings or integers than it works perfectly.
Now we need a propery, we call them "Vendor", that store a GUID of the Vendor from a database. But the user didn´t see the GUID in the PG. he can choose beetwen the venders Names in a combobox. This combobox must be loaded from the database
I have start to try to solve that with following code:
my question: What is the next step? how can i put the data from the SortedList to the needed standardValueCollection?`Code:Public Overrides Function GetStandardValues(ByVal context As System.ComponentModel.ITypeDescriptorContext) As System.ComponentModel.TypeConverter.StandardValuesCollection Dim _Values As New Collections.SortedList If _dtVendors.Rows.Count > 0 Then For Each _rowVendors In _dtVendors.Rows _Values.Add(_rowVendors.VendorsGUID, _rowVendors.VendorsName) Next End If Return _Values End Function
What are the next steps to reach the goal, that not the GUID was shown but the name of the vendor. And how can I store it?




Reply With Quote