﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Issues  » Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Fri, 18 Sep 2026 21:05:30 GMT</lastBuildDate><ttl>20</ttl><item><title>Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><link>http://forum.strataframe.net/FindPost20305.aspx</link><description>Hi,&lt;br&gt;
I am getting a Framework error (see more info below), when opening maintenance form from the main window:&lt;br&gt;
&lt;br&gt;
[codesnippet]ProductMaintenance maintForm = new ProductMaintenance(this.factSheetReportBO.Product_Id);&lt;br&gt;
maintForm.ShowDialog(this);[/codesnippet]&lt;br&gt;
&lt;br&gt;
The main window passes in PK_ID and maintenance form navigates to that ID. The error only happens for one specific PK ID. There's nothing special about this ID, I can't figure out why it would fail on that ID.&lt;br&gt;
By looking at the error message can you tell me what can be causing it, or at least point me to the right direction? &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between 'Minimum' and 'Maximum'.\rParameter name: Value\r   at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object component, Object value)\r   at System.Windows.Forms.Binding.SetPropValue(Object value)\r   at System.Windows.Forms.Binding.PushData(Boolean force)\r   at System.Windows.Forms.Binding.UpdateIsBinding()\r   at System.Windows.Forms.Binding.CheckBinding()\r   at System.Windows.Forms.Binding.SetListManager(BindingManagerBase bindingManagerBase)\r   at System.Windows.Forms.ListManagerBindingsCollection.AddCore(Binding dataBinding)\r   at System.Windows.Forms.BindingsCollection.Add(Binding binding)\r   at System.Windows.Forms.BindingContext.UpdateBinding(BindingContext newBindingContext, Binding binding)\r   at System.Windows.Forms.Control.UpdateBindings()\r   at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)\r   at System.Windows.Forms.ContainerControl.&lt;br&gt;
OnCreateControl()\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)\r   at System.Windows.Forms.Control.CreateControl()\r   at System.Windows.Forms.Control.WmShowWindow(Message&amp; m)\r   at System.Windows.Forms.Control.WndProc(Message&amp; m)\r   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)\r   at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)\r   at System.Windows.Forms.Form.WmShowWindow(Message&amp; m)\r   at System.Windows.Forms.Form.WndProc(Message&amp; m)\r   at System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(Message&amp; m)\r   at System.Windows.Forms.Control.ControlN&lt;br&gt;
ative&amp;#119;indow.WndProc(Message&amp; m)\r   at System.Windows.Forms.Native&amp;#119;indow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"&lt;br&gt;
&lt;br&gt;</description><pubDate>Fri, 24 Oct 2008 09:19:14 GMT</pubDate><dc:creator>Leonard P.</dc:creator></item><item><title>RE: Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><link>http://forum.strataframe.net/FindPost20324.aspx</link><description>LOL...glad you found it :)</description><pubDate>Fri, 24 Oct 2008 09:19:14 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><link>http://forum.strataframe.net/FindPost20322.aspx</link><description>[quote][b]Trent L. Taylor (10/23/2008)[/b][hr]Well, I would assume from looking at the message that you have this field bound to something. Possibly a numeric up down control with a Min and Max range. It may not be this field but another that is bound. That would be the first place I would look.[/quote]&lt;br&gt;
&lt;br&gt;
Trent, that was exactly it!!! I spent hours looking at the code and form's controls. And you nailed it right away without seeing my form! You are a genius!!!   Thank you!</description><pubDate>Fri, 24 Oct 2008 08:59:28 GMT</pubDate><dc:creator>Leonard P.</dc:creator></item><item><title>RE: Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><link>http://forum.strataframe.net/FindPost20309.aspx</link><description>Well, I would assume from looking at the message that you have this field bound to something.&amp;nbsp; Possibly&amp;nbsp; a numeric up down control with a Min and Max range.&amp;nbsp; It may not be this field but another that is bound.&amp;nbsp; That would be the first place I would look.</description><pubDate>Thu, 23 Oct 2008 17:15:04 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Error System.ArgumentOutOfRangeException: Value of '-1' is not valid for 'Value'. 'Value' should be between</title><link>http://forum.strataframe.net/FindPost20308.aspx</link><description>Hi Leonard,&lt;P&gt;[quote]System.ArgumentOutOfRangeException: &lt;STRONG&gt;Value of '-1' is not valid for 'Value'&lt;/STRONG&gt;.[/quote]&lt;/P&gt;&lt;P&gt;It looks like your this.factSheetReportBO.Product_Id value is -1 which means that you are adding a record and the PK has not been saved, you may want to either make sure your Product_Id is a valid PK at the calling form.</description><pubDate>Thu, 23 Oct 2008 17:13:54 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>