Sorry to bother you again but I am getting a bit frustrated with this now. I have searched the net, and I have managed to get the following code (this is edited from your example in vertical grid demo), but when I click on the field it displays the dropdown arrow but does not display a dropdown control like I would expect. I am obviously doing something wrong....... as always.
If you could help me (even more than you have) I would appreshiate it.
_
Public Class FileNameBasedData
Public Class FileNameBasedDataEditor
Inherits System.Drawing.Design.UITypeEditor
Public Sub New()
MyBase.New()
End Sub
Public Overloads Overrides Function GetEditStyle(ByVal context As ITypeDescriptorContext) As System.Drawing.Design.UITypeEditorEditStyle
Return UITypeEditorEditStyle.DropDown
End Function
Public Overloads Overrides Function EditValue(ByVal context As ITypeDescriptorContext, ByVal provider As IServiceProvider, ByVal value As Object) As Object
Dim _fileNameBasedData As FileNameBasedData = CType(value, frmControl.FileNameBasedData)
If (Not _fileNameBasedData Is Nothing) Then
Dim _openFileDialog As New DropDownListColumn
_openFileDialog.Items.Add("hello")
_openFileDialog.Items.Add("hello1")
_openFileDialog.Items.Add("hello2")
Return _fileNameBasedData
End If
Return MyBase.EditValue(context, provider, value)
End Function
End Class
Private _fileName As String
Private Shared _defaultDirectory As String
Shared Sub New()
_defaultDirectory = String.Empty
End Sub
Public Sub New()
_fileName = String.Empty
End Sub
Public Sub New(ByVal fileName As String)
Me._fileName = fileName
End Sub
Public Shared Property DefaultDirectory() As String
Get
Return _defaultDirectory
End Get
Set(ByVal Value As String)
_defaultDirectory = Value
End Set
End Property
Public Overridable Property FileName() As String
Get
Return Me._fileName
End Get
Set(ByVal Value As String)
If (_fileName Value) Then
Me._fileName = Value
End If
End Set
End Property
Public Overridable ReadOnly Property IsEmpty() As Boolean
Get
Return Not (_fileName Is Nothing Or _fileName = String.Empty)
End Get
End Property
Public Overrides Function ToString() As String
Return IIf((Not Me.FileName Is Nothing), _fileName, String.Empty)
End Function
End Class
Thank you so much
Simon