Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
"Simple" DropDownList Editor Control
posted

Sometimes, I want a dropdownlist as an editor control in a grid. Just a dropdownlist. I don't need the power of the WebCombo, and don't want the headache of the new WebDropDown, which needs a ScriptManager which throws "ambiguous" errors.

Just a simple DropDownList would be great!

So, I tried to make a custom DropDownList. It works in all ways except it won't load in the grid. Obviously I'm missing something in the IProvidesEmbeddableEditor implementation. But there is zero documentation on how to use it.

Here is my code. Can anybody help?

<AspNetHostingPermission(SecurityAction.Demand, _
     Level:=AspNetHostingPermissionLevel.Minimal), _
    AspNetHostingPermission(SecurityAction.InheritanceDemand, _
     Level:=AspNetHostingPermissionLevel.Minimal), _
    DefaultProperty("Text"), _
    ToolboxData( _
     "<{0}:UltraWebGridEditorDropDownList runat=""server""> </{0}:UltraWebGridEditorDropDownList>") _
    > _
    Public Class GridEditorDropDownList
        Inherits DropDownList
        Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor

        Public Function CanEditType(ByVal type As System.Type) As Boolean Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor.CanEditType
            Return True
        End Function

        Public Function CanRenderType(ByVal type As System.Type) As Boolean Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor.CanRenderType
            Return True
        End Function

        Public ReadOnly Property EditorClientID() As String Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor.EditorClientID
            Get
                Return Me.ClientID
            End Get
        End Property

        Public ReadOnly Property EditorID() As String Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor.EditorID
            Get
                Return Me.ID
            End Get
        End Property

        Public Function RenderValue(ByVal value As Object) As String Implements Infragistics.WebUI.Shared.IProvidesEmbeddableEditor.RenderValue
            Return Nothing
        End Function
    End Class