Let's suppose we have a grid of customer data. One of the fields is the CountryId (which is linked to a table of Countries) but, maybe, this field is not informed (accepts null values).
public class Customer
{
public int Id { get; set; }
public string Name { get; set; }
public string Address { get; set; }
public int? CountryId { get; set; }
}
public class Country
{
public int Id { get; set; }
public string Name { get; set; }
}
When we show the grid and use the ForeignKey attributes, the data is shown properly: the rows with the Country informed show their name and the rows with null values show nothing. This works perfectly.
Let's suppose now that, for any reason I want to come back the Country to null value in a row that has it informed. When I edit the row, the Country column shows a dropdown with all the available countries... but there's no option to select no value:
I miss an empty row (in fact, a caption, somethink like "Select option.,,"
Hope that now is more clear.
Regards