I'm getting the exact issue. It happens when the grid looks as if its drawing a cell or something.
all i have is one parent grid on one form, I call the child in a dialog manner.
they add things into the shopping cart (wich I do by directly doing this:
Dim x = DataSet.Table1.NewTable1Row
x.x = xxxxx
x.xx = xxxx
DataSet.Table1.AddTable1Row(x)
that works fine,
but if i go to update subtotals when something gets deleted out of the child grid, randomly this error comes up...
especially if i set a value like this more than once
Bindingsource1.current("Subtotal") = 0
for each line in shopping cart
Bindingsource1.current("Subtotal") += line.amount
next
how are you supposed to update subtotals properly to a dataset directly, while it's databound... this only works 50/50.
sometimes the solution is to delete one line out of many that i set in the bindingsource.
[Dataset]
ParentTable - contains totals
-Child Table - contains shopping cart items.
I want to update parent table values, and child values. bi-directionally in one sub called update totals
for example setting "Freight = x" on a shopping cart item should update the sum of the freight in the parent datarow
update all when deleting rows etc...
basic stuff
System.IndexOutOfRangeException: Index 3 does not have a value.
at System.Windows.Forms.CurrencyManager.get_Item(Int32 index)
at System.Windows.Forms.DataGridViewRow.get_DataBoundItem()
at lib_Payments.PaymentExtensions.IsOrderFullPayment(DataGridViewRow Expression) in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_Payments\Helper Classes\PaymentExtensions.vb:line 9
at System.Collections.Generic.List`1.FindAll(Predicate`1 match)
at lib_DataAccess.DataGridViewExtensions.ColorCells(DataGridView Expression, List`1 ColorSettings) in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_DataAccess\DataGridViewExtensions.vb:line 19
at lib_Payments.ShoppingCartControl.ColorShoppingCartGrid() in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_Payments\Controls\ShoppingCartControl.vb:line 1536
at lib_Payments.ShoppingCartControl.CcProcessingDetailDataGridView_RowsAdded(Object sender, DataGridViewRowsAddedEventArgs e) in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_Payments\Controls\ShoppingCartControl.vb:line 1726
at System.Windows.Forms.DataGridView.OnRowsAdded(DataGridViewRowsAddedEventArgs e)
at System.Windows.Forms.DataGridView.OnRowsAddedInternal(Int32 rowIndex, Int32 rowCount)
at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged_PostNotification(CollectionChangeAction cca, Int32 rowIndex, Int32 rowCount, DataGridViewRow dataGridViewRow, Boolean changeIsDeletion, Boolean changeIsInsertion, Boolean recreateNewRow, Point newCurrentCell)
at System.Windows.Forms.DataGridViewRowCollection.OnCollectionChanged(CollectionChangeEventArgs e, Int32 rowIndex, Int32 rowCount)
at System.Windows.Forms.DataGridViewRowCollection.AddInternal(DataGridViewRow dataGridViewRow)
at System.Windows.Forms.DataGridView.RefreshRows(Boolean scrollIntoView)
at System.Windows.Forms.DataGridView.RefreshColumnsAndRows()
at System.Windows.Forms.DataGridView.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at System.Windows.Forms.ContainerControl.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnParentVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Form.OnVisibleChanged(EventArgs e)
at System.Windows.Forms.Control.SetVisibleCore(Boolean value)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at lib_Payments.PaymentControl.ShowShoppingCart() in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_Payments\Controls\PaymentControl.vb:line 1676
at lib_Payments.PaymentControl.ShoppingCartButton_Click(Object sender, EventArgs e) in C:\Documents and Settings\administrator\My Documents\Visual Studio 2008\Projects\madison online\lib_Payments\Controls\PaymentControl.vb:line 1643
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)