Binding.NullValue Binding.NullValue Binding.NullValue Binding.NullValue Property

定义

获取或设置当数据源包含 Object 值时,作为控件属性设置的 DBNullGets or sets the Object to be set as the control property when the data source contains a DBNull value.

public:
 property System::Object ^ NullValue { System::Object ^ get(); void set(System::Object ^ value); };
public object NullValue { get; set; }
member this.NullValue : obj with get, set
Public Property NullValue As Object

属性值

当数据源包含 Object 值时,作为控件属性设置的 DBNullThe Object to be set as the control property when the data source contains a DBNull value. 默认值为 nullThe default is null.

注解

数据源必须包含DBNull NullValue , 才能正确应用属性。The data source must contain DBNull for the NullValue property to be correctly applied. 如果数据源类型为类型 (如字符串或整数), 则将忽略NullValue属性的值。If the data source type is a type such as a string or integer the value of the NullValue property will be ignored. 此外, 如果NullValue将属性设置为null, 则忽略该属性。Also, the NullValue property is ignored if it is set to null.

如果将控件属性设置为的对象NullValue, 则会向数据源中添加 null 值。A null value will be added to the data source when the control property is set to the object of NullValue. 如果NullValue设置为字符串值, 则比较不区分大小写。If NullValue is set to a string value, comparisons are case-insensitive.

适用于