Is there a way to access the values of the data in the Internal Combobox BO? or should we just use the PK field returned by the BindingField to look for the data again manually?
Hi Greg,
I finally had the chance to play with this, even though I have done this a lot of time with the listviews and like you said, it does work nicely, but it would do a very good enhancement to get access to the internal combobox BO.
Anyway here is the code I am using from the 2 comboboxes to illustrate this functionality:
Private Sub cboItemType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboItemType.SelectedIndexChanged '-- Filter the cboItemName combobox data with the following parameters: ' Pass the PrimaryBO EditingState to filter out Active records if needed. ' The name of the Inactive Status field ' The ItemType value ' And the Appliance used. Me.BizItems_Lookup.Clear() Me.BizItems_Lookup.FillByActiveRecords(Me.bizSC_AppliancesItems1.EditingState, "ItemIsInactive", Me.bizSC_AppliancesItems1.ItemType, Me.BizSC_Appliances1.FK_Appliances) Me.cboItemName.Requery()End Sub Private Sub cboItemName_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles cboItemName.ListPopulating e.Parameters(0).Value = Me.BizItems_Lookup e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultViewEnd Sub Private Sub cboItemName_DropDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboItemName.DropDown If bizSC_AppliancesItems1.Count > 0 Then Me.cboItemName.Requery() Else Me.cboItemName.Items.Clear() End IfEnd Sub Private Sub cboItemName_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboItemName.SelectedIndexChanged If Me.BizItems_Lookup.Count > 0 Then If Me.BizItems_Lookup.SeekToPrimaryKey(Me.bizSC_AppliancesItems1.FK_Items) Then Me.bizSC_AppliancesItems1.ItemPrice = Me.BizItems_Lookup.ItemPrice End If End IfEnd Sub
e.Parameters(0).Value =
e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView
Hi Trent,
Thanks for the info, but when testing your code above, I got an error that there is not Item property. I have tried several ways to get access to any of the field values in the combo, but none worked.
Could you please post the correct syntax to reference the combo field values?
CType(Me.cboItemName.DataSource, DataTable).Rows(Me.cboItemName.SelectedIndex).Item("ItemPrice")
Here is the DataTable which only shows 3 columns and the column I would like to see "ItemPrice" its value is in the DropDown column:
I already implemented the method of using another BO for lookup, but if this can work, then it will be easier to maintain and re-use in other forms.