What you said I understand. But how does a value in the datasource relate to the scrollbar? I don't have any databindings to a scrollbar. I don't have a scrollbar control (unless you mean the form contains a scrollbar control). Plus like I said, it's random. So the user must be doing something different to set this up.
Bellow is the rest of the stacktrace. I didn't include it before because it just traces back to when I set the datasource of my database.
Notes:
c:\projects\csnet\commoncontrolscsharp\ucsgrid.cs:line 113 // this is my datagrid with this line sets the datasource property.
************** Exception Text **************
System.ArgumentException: '0' is not a valid value for 'value'. 'value' should be between 'minimum' and 'maximum'.
at System.Windows.Forms.ScrollBar.set_Value(Int32 value)
at System.Windows.Forms.DataGrid.SetDataGridTable(DataGridTableStyle newTable, Boolean forceColumnCreation)
at System.Windows.Forms.DataGrid.Set_ListManager(Object newDataSource, String newDataMember, Boolean force, Boolean forceColumnCreation)
at System.Windows.Forms.DataGrid.Set_ListManager(Object newDataSource, String newDataMember, Boolean force)
at System.Windows.Forms.DataGrid.set_DataSource(Object value)
at commonControlsCSharp.SGrid.PopulateSGrid(DataSet dsData, String strMapName, Boolean bAllowNew, Boolean bAllowDelete) in c:\projects\csnet\commoncontrolscsharp\ucsgrid.cs:line 113
at Delivery.PrintLabel.btnSearch_Click(Object sender, EventArgs e) in c:\projects\csnet\delivery\printlabel.cs:line 642
at Delivery.PrintLabel.txtDocket_KeyPress(Object sender, KeyPressEventArgs e) in c:\projects\csnet\delivery\printlabel.cs:line 1045
at System.Windows.Forms.KeyPressEventHandler.Invoke(Object sender, KeyPressEventArgs e)
at System.Windows.Forms.Control.OnKeyPress(KeyPressEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--
KeithH
"Ying-Shen Yu[MSFT]" said:
Hi Keith,
This exception is probably happened when filling value into the Value
property of a scrollbar or its derived control. this error is probably
related to the value in the data source, if the value set to the scrollbar
is 0 which is below your minmum setting in the scrollbar control. It will
thrown this exception.
If you have the complete call stack of this exception, please post it so
that we can get more information of this issue.
Thanks!
Best regards,
Ying-Shen Yu [MSFT]
Microsoft Community Support
Get Secure! -
www.microsoft.com/security
This posting is provided "AS IS" with no warranties and confers no rights.
This mail should not be replied directly, please remove the word "online"
before sending mail.