' Parent Retrieved hook method Protected Overrides Sub HookParentRetrieved _ (ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs) Me.GetCompanyByCompanyId(e.PrimaryKeyValue) End Sub2. The form has the CompanyList Business Object defined as the Parent of the Company Business Object as follows:
Public Sub New() MyBase.New() 'Instantiate and register business objects with the form Me.oCompanyList = _ CType(Me.RegisterPrimaryBizObj(New CompanyList), CompanyList) Me.oCompany = CType(Me.RegisterBizObj(New Company), Company) Me.oLogoShape = CType(Me.RegisterBizObj(New LogoShape), LogoShape) ' Me.oPrintLogoOrName = _ ' CType(Me.RegisterBizObj(New PrintLogoOrName), PrintLogoOrName)() ' Register the Company object as a child of the Company List object Me.oCompanyList.RegisterChildBizObj(Me.oCompany) ' Instantiate and register business rule objects with the form Me.oCompanyRules = _ CType(Me.oCompany.GetBusinessRuleObject(), CompanyRules) 'This call is required by the Windows Form Designer. InitializeComponent() ' Retrieve all Business Object data Me.oCompanyList.GetCompanyList()3. After I select a value in an UltraComboBox I expect to raise a BusinessStateChangeEvent that will call the following (in my Company Bus Obj):
' Parent Navigated hook method Protected Overrides Sub HookParentNavigated _ (ByVal bizObj As mmBusinessObject, ByVal e As mmBusinessStateChangeEventArgs) Me.GetCompanyByCompanyId(e.PrimaryKeyValue) End SubWHAT DO I NEED TO DO WITHIN MY ULTRACOMBO_VALUECHANGED event to raise this BusinessStateChangeEvent correctly and cause the Customer Business Object's HookParentNavigate event to fire (thus getting the Company By Id shown above)? I am assuming I have to navigate to the record selected but not sure how to do this in a way that would fire the HookParentNavigate.
Private Sub CompanySelectionUltraCombo_ValueChanged _ (ByVal sender As Object, ByVal e As System.EventArgs) _ Handles CompanySelectionUltraCombo.ValueChanged 'This did not work: Me.CompanySelectionUltraCombo.NavigateData _ ' (Me.BindingContext, oCompanyList, mmNavigate.First) 'This was not good syntax: Me.oCompanyList.StateChangeHandler(oCompanyList, mmBusinessState.Navigated) End Sub4. After I press one of my navigation buttons , I still am not raising the HookParentNavigate event as expected
Private Sub buttonMoveNext_Click _ (ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles buttonMoveNext.Click ' Navigate to next record in dataset Me.CompanySelectionUltraCombo.NavigateData _ (Me.BindingContext, oCompanyList, mmNavigate.Next) ' Update form fields with new value selected Me.CompanyFormSetFieldValues() End SubI know the navigation is occuring as I also have an Update Buttons function (as follows) that is correctly determining the current position within the dataset and applying the appropriate GUI changes after I press one of the nav buttons.
Private Sub UpdateButtons() Select Case Me.GetCurrentPosition(oCompanyList) Case 0 Me.buttonMovePrev.Enabled = False Me.buttonMoveFirst.Enabled = False Me.buttonMoveNext.Enabled = True Me.buttonMoveLast.Enabled = True Case oCompany.GetRowCount() - 1 Me.buttonMoveNext.Enabled = False Me.buttonMoveLast.Enabled = False Me.buttonMovePrev.Enabled = True Me.buttonMoveFirst.Enabled = True Case Else Me.buttonMoveNext.Enabled = True Me.buttonMoveLast.Enabled = True Me.buttonMovePrev.Enabled = True Me.buttonMoveFirst.Enabled = True End Select Me.CurrentRowUltraTextEditor.Text = _ CStr(Me.GetCurrentPosition(oCompanyList) + 1) Me.NumberOfRecordsUltraLabel.Text = "of " & oCompanyList.GetRowCount() End Sub