Author: ja | Posted on: 2/10/2010 12:37:21 AM | Views : 328

Hi i know some of you may got this error sometime: 
System.ArgumentOutOfRangeException: 'DropDownList' has a SelectedValue which is invalid because it does not exist in the list of items.this question has been for a long time ago but seem no actual answer for it except for catching the exception.
I don't want just catch error instead of check first whether the value exist in drop down list. My scenario was different from the other. my data source is bind to a datatable, all is in hard code. But when i use the code like this:
If Formview1.CurrentMode = FormViewMode.Edit Then
Dim rowView As DataRowView = CType(Formview1.DataItem, DataRowView)
If Not Go to the complete details ...