Hi,

I have created a Windows UserControl. This Control hosts a PropertyGrid and
a Button control. The UserControl project also includes a class called
"TestClass" and a custom TypeConvertor class called "DDConv".

When the user clicks on the Button control, the application assigns an
instance of "TestClass" to the PropertyGrid.

The "TestClass" has a property called "CustProp" and it has an
TypeConverter attribute assigned to the "CustProp" property. The
TypeConvertor points to the "DDConv" class.

The PropertyGrid in the UserControl displays a DropDown against the
"CustProp" property when the UserControl is hosted in a windows application.

When the UserControl is hosted in Internet Explorer, the PropertyGrid does
NOT SHOW any DropDown for the "CustProp" property.

NOTE: I test the UserControl in Internet Explorer from a virtual directory
on my machine. I have set "FullTrust" for the "LocalIntranet_Zone" on my
machine.

I want the PropertyGrid to display the DropDown in Internet Explorer - can
someone help me in figuring out how to acheive the same?

'TestClass.vb
Public Class TestClass
Dim _name As String
Dim _ddProp As String

Public Property Name() As String
Get
Return _name
End Get
Set(ByVal Value As String)
_name = Value
End Set
End Property

<System.ComponentModel.TypeConverter(GetType(DDConv))> _
Public Property CustProp() As String
Get
Return _ddProp
End Get
Set(ByVal Value As String)
_ddProp = Value
End Set
End Property

End Class

'DDConv.vb
Public Class DDConv
Inherits System.ComponentModel.StringConverter

Dim _values As String()
Dim _restrictToList As Boolean

Public Sub New()
_values = New String() {"Yes", "No"}
End Sub

Public Overloads Overrides Function GetStandardValuesSupported _
(ByVal context As _
System.ComponentModel.ITypeDescriptorContext) As Boolean

Return True
End Function

Public Overloads Overrides Function GetStandardValues(ByVal _
context As System.ComponentModel.ITypeDescriptorContext) _
As _
System.ComponentModel.TypeConverter.StandardValuesCollection

Return New StandardValuesCollection(_values)

End Function

Public Overloads Overrides Function GetStandardValuesExclusive _
(ByVal context As _
System.ComponentModel.ITypeDescriptorContext) As Boolean

Return _restrictToList
End Function
End Class


Thanks & Regards,
Dhwanil Shah
dhwanil.shah@patni.com

--
Message posted via http://www.dotnetmonster.com