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
1187
Inherit UltraComboEditor for custom UserControl with fixed values
posted

We have several drop downs in our app with fixed values that get used repeatly in the application.  How can we create a custom user control that inherits from UltraComboEditor with a fixed value list?  We have tried a few things, most recently the code below.  With the code below, we end up the the value list repeatly appending and therefore the values show multiple times at runtime.  Is there a way to create a custom user control with a fixed value list?

 

Public Class ComboTaxFlag
    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        Me.ValueList.ValueListItems.Clear()
        Me.ValueList.ValueListItems.Add(E_TAXFLAG.YES, "Yes")
        Me.ValueList.ValueListItems.Add(E_TAXFLAG.NO, "No")
        Me.ValueList.ValueListItems.Add(E_TAXFLAG.TAX1, "Tax 1")
        Me.ValueList.ValueListItems.Add(E_TAXFLAG.TAX2, "Tax 2")

        Me.Value = E_TAXFLAG.YES

    End Sub

End Class