I have the following code in the combo...
e.Parameters(0).Value =
I am populating the combo with a method I created in the BO:
cmd.CommandText =
This is working fine, except when I add a new record and instead of saving I cancel it with the following code:
DeleteAllPaymentSchedule()
I get the following error:
Source : MicroFour StrataFrame Business
Stack Trace: at MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentRow() at IBS_BOL.PolicyBO.get_FK_InsuranceCompany() in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\BOL\IBS_BOL\Main Forms BOs\PolicyBO.Designer.vb:line 358 at IBS_UI.frmPolicy.cboPolicySymbol_ListPopulating(ListPopulatingEventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\UI\Main Forms\frmPolicy.vb:line 176 at MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.RaiseListPopulatingEvent(ListPopulatingEventArgs e) at MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateComboFromBusinessObject(IListControl lstControl, Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ListControl.PopulateCombo(Control lstControl, Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.PopulateCombo(Object[] Parameters) at MicroFour.StrataFrame.UI.Windows.Forms.ComboBox.Requery() at IBS_UI.frmPolicy.PolicyBO1_Navigated(NavigatedEventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\UI\Main Forms\frmPolicy.vb:line 165 at MicroFour.StrataFrame.Business.BusinessLayer.NavigatedEventHandler.Invoke(NavigatedEventArgs e) at MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(NavigatedEventArgs e) at MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(NavigatedEventArgs e) at MicroFour.StrataFrame.Business.BusinessLayer.Navigate(BusinessNavigationDirection Direction, Int32 AbsoluteIndex, Object[] PrimaryKeyValues, Boolean AttemptToCheckRules, Boolean IsRefill) at MicroFour.StrataFrame.Business.BusinessLayer.RestoreCurrentRowIndex(Boolean RefreshUI) at MicroFour.StrataFrame.Business.BusinessLayer.Undo(BusinessUndoType UndoType) at IBS_UI.frmPolicy.cmdCancel_Click(Object sender, EventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Insurance Broker System (SF)\UI\Main Forms\frmPolicy.vb:line 106 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m) at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
If I replace the ComboBox Listpopulating with this code, it will fix the error, but I am not sure if this is something I should do with all my ComboBoxes ListPopulating event parameters....
e.Parameters(0).Value = 0
P.S.
Sorry for the long post, but it was needed.
Another thing you might think about is using the Rowstate instead of the EditingState of the BO. For example:
Ultimately this is a more true reflection of what is going on with the record than the EditingState (which is used more for interacting with the UI).
I applied the changes and tested and everything works fine.