Err : Specified argument was out of the range of valid values.
Parameter name: '-2147483643' is not a valid value for 'index'.
Doug Lott
I get the same error on just one value (which happens to be 2nd in the list)
in my combobox.The combobox in question is bound to a datatable and
later in the load event, the selectedvalue property is assigned a value
from a custom object.
cboCurrentStatus.SelectedValue = _projectList.CurrentStatus
This works as long as the value is not the 2nd item in the collection.
If it is the 2nd item,I get the "Specified argument was out of the range
of valid values" error. On the other hand, if I replace the above
code with:
For Each item As Object In Me.cboCurrentStatus.Items
If CType(item, DataRowView)(0).ToString() = projectList.CurrentStatus.ToString Then
Me.cboCurrentStatus.SelectedItem = item
End If
Next
it works just fine even when currentSatus is the 2nd item in the collection.
Can anyone explain this?
--------------------------------
From: Doug Lott
ที่มา
http://www.dotnet247.com/247reference/msgs/29/148796.aspx