I have an Edit page in my application that contains a DropDownList.
This DDL is bound to an EntityDataSource that only shows the active "ProjectManagers".
In the case where the user is editing a record that is assigned to an "inactive" ProjectManger, an "ArgumentOutOfRange" Exception is (rightfully) thrown by the DDL (because that Item wan't bound to the list, since it only binds "Active" ProjectManagers).
So, I need to add this item to the DropDownList dynamically or at least add an "Inactive" item and then "select" that item in the code behind. (Although, adding an "Inactive" item would force the user to actually change the ProjectManager and that wouldn't be a good idea.)
I have tried handling the OnDataBinding method with the following code:
protected void PreventErrorOnBinding(object sender, EventArgs e)
{
Go to the complete details ...