Design Time Data Binding - Infragistics Combo

Posts   
 
    
Mark
User
Posts: 2
Joined: 01-Sep-2005
# Posted on: 13-Sep-2005 23:07:58   

Does anyone know how at design time to bind a collection to an Infragistics Combo Box?

I have an CustomerEntity that has a fk reference to a StatesEntityCollection. The StatesEntityCollection is simply the look up table of all of the states available. I have not been able to figure out any method that would allow me to list all of the states in the table in a Infragistics Combo Box, allow the user to select one and have it bound back to the Entity.

Any ideas?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Sep-2005 11:21:23   

At design time, I'm not sure if it will work, but at runtime it should work. Does it work at runtime, when you set it up in code?

Frans Bouma | Lead developer LLBLGen Pro
jwalling
User
Posts: 1
Joined: 15-Sep-2005
# Posted on: 15-Sep-2005 22:35:01   

We make our state combo responsible for getting it's data at runtime (not design time) by loading the collection of entities on the combo boxes OnEndInit. Here's a code snippet that checks to see that we're running and then binds and clears the cloumns we don't want to see. If your object is only returning fields you want to see, then you can skip the looping through all the grid's columns and hiding the ones you don't care about.

Protected Overrides Sub OnEndInit()

    If appBase.IsRunning = True Then
        Dim states As CollectionClasses.StateCollection = New CollectionClasses.StateCollection
        states.GetMulti(Nothing)

        Me.DataSource = states
        Me.DisplayMember = "Code"
        Me.ValueMember = "Id"

        For Each ugc As UltraGridColumn In Me.DisplayLayout.Bands(0).Columns
            If ugc.Key <> "Code" AndAlso ugc.Key <> "Description" Then
                ugc.Hidden = True
            End If
        Next
    End If
End Sub

I hope this helps.