Note that there are some explanatory texts on larger screens.

plurals
  1. PONullable database property but texbox still shows red border when content deleted
    primarykey
    data
    text
    <p>Hi I am binding a WPF textbox to an Entity Framework property as follows:</p> <pre><code>&lt;TextBox Grid.Column="1" Grid.Row="0" Margin="5,2" Text="{Binding Path=MyEntityObject.SizeLower, Mode=TwoWay}" /&gt; </code></pre> <p>It binds fine to the property and when I change it, it saves to the DB as expected. But if I delete the content of the Textbox I get the red error border around it. I dont have any validator in place so I am guessing the texbox is complaining about the value not being nullable. But in fact this property in the DB is nullable, so I cannot understand why it would error.</p> <p>The system generated EF property definition is as follows:</p> <pre><code>&lt;EdmScalarPropertyAttribute(EntityKeyProperty:=false, IsNullable:=true)&gt; &lt;DataMemberAttribute()&gt; Public Property SizeLower() As Nullable(Of Global.System.Int64) Get Return _SizeLower End Get Set OnSizeLowerChanging(value) ReportPropertyChanging("SizeLower") _SizeLower = StructuralObject.SetValidValue(value) ReportPropertyChanged("SizeLower") OnSizeLowerChanged() End Set End Property Private _SizeLower As Nullable(Of Global.System.Int64) </code></pre> <p>Is there something I am missing? I thought the binding system was able to determine if a property was nullable and allow nulls if so?</p> <p>How can I see what the error is? Hovering doesnt seem to do the trick.</p> <p>Thanks for any advice.</p> <p>=================================== ADDITIONAL INFO</p> <p>If I select all and delete, then change focus, the validation box appears. Here's a screencapture before and after. Also I have confirmed that I can manually put NULLs in the database for the bound properties so thats not the problem.</p> <p>DENIED. Tried to put picture here but I dont have 10 points...! Here is an offsite link instead: <a href="http://ebaypics.net/ProgrammingPics/RedSelectionBox.gif" rel="nofollow">CLICK HERE</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload