# Form designer: GridView with DropDownListBox field column: An ArgumentOutOfRangeException can occur at runtime when the drop-down list does not contain an empty string value item

**URL:** <https://discuss.workflowgen.com/t/form-designer-gridview-with-dropdownlistbox-field-column-an-argumentoutofrangeexception-can-occur-at-runtime-when-the-drop-down-list-does-not-contain-an-empty-string-value-item/246>\
**Category:** Form Designer\
**Created:** [July 25, 2013, 12:54am UTC](https://discuss.workflowgen.com/t/form-designer-gridview-with-dropdownlistbox-field-column-an-argumentoutofrangeexception-can-occur-at-runtime-when-the-drop-down-list-does-not-contain-an-empty-string-value-item/246 "2013-07-25T00:54:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [July 25, 2013, 12:54am UTC](https://discuss.workflowgen.com/t/form-designer-gridview-with-dropdownlistbox-field-column-an-argumentoutofrangeexception-can-occur-at-runtime-when-the-drop-down-list-does-not-contain-an-empty-string-value-item/246/1 "2013-07-25T00:54:30Z")

</div>

**Issue**

When you launch a form with a GridView that has a DropDownListBox as one of the column fields, and the drop-down list field doesn’t contain an empty string value item, you might get the following .NET exception error at runtime:

```auto
[ArgumentOutOfRangeException: '[DROPDOWNLISTBOX_ID]' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value]
   System.Web.UI.WebControls.ListControl.PerformDataBinding(IEnumerable dataSource) +1379
   System.Web.UI.WebControls.ListControl.OnDataBinding(EventArgs e) +408
   System.Web.UI.WebControls.ListControl.PerformSelect() +44
   System.Web.UI.Control.DataBindChildren() +248
   ...

```

This is a known behavior due to the data binding nature of the GridView and the DropDownListBox controls.

The `System.ArgumentOutOfRangeException` is raised when the GridView tries to bind the default value (which is an empty string) to the missing empty string value item in the drop-down list field in the GridView in Edit mode.

**Solution**

The solution is to always keep an empty string value item (with a `Select an item` text, for example) in the DropDownListBox field.
