Binding.DataSourceNullValue Binding.DataSourceNullValue Binding.DataSourceNullValue Binding.DataSourceNullValue Property

定义

获取或设置将存储在数据源中的值(如果控件值为 null 或为空)。Gets or sets the value to be stored in the data source if the control value is null or empty.

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

属性值

当控件属性为空或为 null 时,将存储在数据源中的 ObjectThe Object to be stored in the data source when the control property is empty or null. 对于值类型,默认为 DBNull;对于非值类型,则默认为 nullThe default is DBNull for value types and null for non-value types.

注解

当数据源包含NullValue DBNull时, 可以使用属性来指定绑定控件中显示的值。You can use the NullValue property to specify the value displayed in a bound control when the data source contains DBNull.

适用于

另请参阅