首页 > 代码库 > dev gridcontrol 绑定int型的列默认当值为0时为空

dev gridcontrol 绑定int型的列默认当值为0时为空

 xmlns:sys="clr-namespace:System;assembly=mscorlib"

<dxg:GridColumn Header="测试" FieldName="整型">
                    <dxg:GridColumn.EditSettings>
                        <dxe:TextEditSettings>
                            <dxe:TextEditSettings.NullValue>
                                <sys:Int32>0</sys:Int32>
                            </dxe:TextEditSettings.NullValue>
                        </dxe:TextEditSettings>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>

                <dxg:GridColumn Header="日期" FieldName="rDate">
                    <dxg:GridColumn.EditSettings>
                        <dxe:DateEditSettings NullValue="http://www.mamicode.com/{x:Static sys:DateTime.MinValue}"/>
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>

这样日期型就会默认显示为空字符 而不会显示默认的时间

dev gridcontrol 绑定int型的列默认当值为0时为空