The data I am listing in the grid has a date field that can contain null dates. However, instead of displaying a blank cell for a null date, the grid display '1/1/0000'. Is there any way to get the grid to display a blank cell for a null date?
The same goes for a null value in a number field. The grid displays zeros when I would just like to have the cell blank.
Thanks.
DynoComp
To enable a Infragistics grid date column to allow null value, try the following steps:1) In your business object class (a bindable data source that binds to the grid), create a property using the nullable date type: Public Property YourOptionalDate() As Nullable(Of Date)2) Then set these Infragistics Grid settings: Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").Style = Infragistics.Win.UltraWinGrid.ColumnStyle.Date Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.OnMouseEnter Me.UltraGrid1.DisplayLayout.Bands(0).Columns("YourOptionalDate").Nullable = Infragistics.Win.UltraWinGrid.Nullable.NothingThen you will get a grid with a optional date column that correctly displays null. Hope it helps. Bernard Pang
If you can't chance the value to null, it sounds to me like the data source you are binding to the grid will not allow nulls. The DateTime data type in DotNet (as I said above) is a struct and cannot be set to null.
Was this ever resolved? My data source is an array of data objects. If any of the date fields are null, they are actually set to 1/1/0001 (MinValue).
eric
I am having the same problem with dates.it displays a "01/001/0001" for a date that is null in the database.
how do I havdle this in the wingrid.
thanks
What kind of data source are you using? The grid should be able to display a null in a date field if the data source actually returns null. But the DateTime data type in DotNet cannot handle nulls, so what data type is the field you are looking at here?