Hi Charles.
I think I found a way to handle this, not sure you will like it, but it seems to be working.
The idea is to add an unbound column to you grid, you can do that with the grid designer clicking on the "Add Unbound Column" button at the Columns treeview item. Give it a Key name, like ubc_Date. Set its DataType to System.DateTime. We will use this unbound column to store your date from the table. Have a look at the code and let me know.
#Region " Private Fields "
'-- keep current cell state
Dim _CellUpdating As Boolean = False
#End Region
#Region " Handled Events "
Private Sub grdYourGrid_InitializeRow(ByVal sender As Object, _
ByVal e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) _
Handles grdYourGrid.InitializeRow
'-- check if there are rows to be initialized
If Me.grdYourGrid.Rows.Count() = 0 Then
Exit Sub
End If
'-- move record point to current row
YourTableBO1.SeekToPrimaryKey(e.Row.Cells("yt_pk").Value)
'-- if cell is updating, don't set unbound column
If _CellUpdating = False Then
'-- if underlying table has #1/1/1800#, show empty cell for date
If YourTableBO1.yt_Date = #1/1/1800# Then
e.Row.Cells("ubc_Date").Value = DBNull.Value
Else
e.Row.Cells("ubc_Date").Value = YourTableBO1.yt_Date
End If
End If
'-- reset the flag
_CellUpdating = False
End Sub
Private Sub grdYourGrid_AfterCellUpdate(ByVal sender As Object, _
ByVal e As Infragistics.Win.UltraWinGrid.CellEventArgs) _
Handles grdYourGrid.AfterCellUpdate
'-- if unbound date column, deal with empty date
If e.Cell.Column.Key = "ubc_Date" Then
If e.Cell.Value Is DBNull.Value Then
YourTableBO1.yt_Date = #1/1/1800#
Else
YourTableBO1.yt_Date = CDate(e.Cell.Value)
End If
End If
'-- set the cell state to updating
_CellUpdating = True
End Sub
#End Region