Author: avtuvy | Posted on: 8/12/2010 9:26:15 AM | Views : 228

I have seen some solutions for that problem in several forums but I cannot figure out why it does not work in my case
My project includes a GridView which gets populated  using a LINQ query, some fields in the gridView can be edited and I use a DropDownList for those fields, the problem is that when in the database the data for that field is null it crushes because null is not in the value list, below is my code, please help.
 
<asp:TemplateField HeaderText="Disposition" SortExpression="DISP"> <EditItemTemplate> <asp:DropDownList AppendDataBoundItems="true" ID="DispositionDDL" runat="server" SelectedValue='<%# Bind("DISP", "{0}") %>'> <asp:ListItem>Y</asp:ListItem> ...

Go to the complete details ...