Populate ComboBox when BO needs a datasource key


Author
Message
Jason Seidell
Jason Seidell
StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)StrataFrame User (153 reputation)
Group: Forum Members
Posts: 59, Visits: 180
I'm trying to figure out how to populate a combo box but I need to be able to set a DatasourceKey in the autopopulate settings and cannot.  When I try to manually populate the control I get data but as soon as you select an item the entire form locks and you cannot set focus to any other controls.  I'm completely lost as to why the combobox locks the form.

I'm frustrated that I cannot set the DatasourceKey for the population business object, and that I cannot find any examples for manually populating a business object.  All the documentation says to 'search for combobox population', and a vague reference to needing a datatable but no specifics for required fields.  Which seems odd since you populate a combobox with objects not datatables, or is there some interface the combobox items needs to support?

Jason

Jason Seidell

Programmer/Analyst

Infinedi

Reply
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Hi Jason.

In this case, your BusinessObjectB needs a DatasourceKey. As you say you are working with multiple databases, it looks like you are not setting this property at the BO. Nevertheless, you will need to do it, since you don't have the default "" datasourcekey set to any connection.

The combobox has a ListPopulating method where you can set the Parameters do the Fill method you created in the BusinessObjectB to fill the combobox items.

    Private Sub ComboBox1_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs)
        '-- send the desired datasourcekey
        e.Parameters(0).Value = whateverDataSourceKey
    End Sub

Then your fill method would be set to accept this parameter, being the DatasourceKey. Then, the first thing inside your fill method could be:

Me.DataSourceKey = MyDatasourceKeyParameter
Me.ReCreateDataLayer()

And then carry on with your fill method.

I haven't tried this yet, so let us know if it helps ltaer. Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search