locked
Error:Value doesnot fall within the expected range... RRS feed

  • Question

  • Hi all,

            I have a checkbox, a Cart and some CartItems(products).

    If i checked the checkbox a cartItem(product) adds to the Cart. If i unchecked it the cartItem will be removed from the Cart.

    Now the problem is it works fine if i checked and unchecked the same cartItem for the first time. But at the second time if i  Checked the same cartItem it is giving an error. The error is as follows:

    Sys.InvalidOperationException: ManagedRuntimeError error #4002 in control 'Xaml1': System.ArgumentException: Value does not fall within the expected range. at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData) at System.Windows.DependencyObject.MethodPack(IntPtr objectPtr, String methodName, Object[] rawData) at System.Windows.DependencyObject.MethodPack(String methodName, Object[] rawData) at System.Windows.PresentationFrameworkCollection`1.AddImpl(Object value) at System.Windows.PresentationFrameworkCollection`1.Add(T value) at SilverStore.Page.AddCartItem(String cartItem) at SilverStore.Page.sbCopy_Completed(Object sender, EventArgs e) at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args) at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
     

    can anyone have an idea  on how to overcome this situation???

     

    -Thanks 

     

    Monday, May 5, 2008 2:20 AM

Answers

  • I had this error message when I assigned a single object to the DataContext of two different controls. I could work around it by setting the initial DataContext to null or making a copy of the object.

    Tuesday, May 6, 2008 6:10 AM

All replies

  • Hi:

      Could you paste some code?

    Thanks

    Tuesday, May 6, 2008 2:42 AM
  • I had this error message when I assigned a single object to the DataContext of two different controls. I could work around it by setting the initial DataContext to null or making a copy of the object.

    Tuesday, May 6, 2008 6:10 AM