Hi there
I would like to use a bound combo editor, which provides the possiblity to assign no item at all (setting the property of the record's DataItem to null). The closest thing I've seen to solve this issue is a comment in the online help about an IsNullable property:
Note that the NullText does not specify whether the user is allowed to enter null values into the editor. For that, use the IsNullable property.
However,it appears there is no such property available. Any idea how this should be solved?
Thanks for your advice
Philipp
It seems that the online help is wrong. The ValueEditor base class exposes a ValueConstraint property that exposes a property named 'Nullable'.
Hi Joe
Thanks for the hint. However, this does not solve my issue (the default value of the constraint is to allow null anyway) - I still can't set a null value through the UI as the XamComboEditor limits me to its items (which have been determined using a binding expression). Is there some built-in functionality that allows me to set a cell/editor value to null, or do I have to apply a hack for now?
Cheers
ps: As for users who found the posting searching for a ValueConstraint sample, here's how I applied it:
<!-- defines the dropdown list to specify unit flags --><Style TargetType="{x:Type igEditors:XamComboEditor}" x:Key="Grid_UnitList"> <Setter Property="ItemsProvider"> <Setter.Value> <igEditors:ComboBoxItemsProvider ValuePath="UnitId" DisplayMemberPath="DefaultName" ItemsSource="{Binding Path=CurrentProject.Units}" /> </Setter.Value> </Setter> <Setter Property="ValueConstraint"> <Setter.Value> <igEditors:ValueConstraint Nullable="True" /> </Setter.Value> </Setter> <Setter Property="DropDownResizeMode" Value="None" /></Style>