Paul,
How about using a STRING type in the datagrid instead of a DATE type.
In your get property function you can check to see if the value is null or
not. If its null, send back blanks or whatever you want. If its valid,
send the date value back as a string.
Mike
"Paul Say" <sa****@tpg.com.au> wrote in message
news:up**************@TK2MSFTNGP09.phx.gbl...
This didn't work 1/01/0001 is still displayed in the datagrid, I think
this is because the property is returning a value of datatype datetime and when
a datetime type is of value nothing the value is 1/01/0001
"Jos" <jo***************@fastmail.fm> wrote in message
news:e7****************@TK2MSFTNGP10.phx.gbl... "Paul Say" <sa****@tpg.com.au> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... I have a class called Job, that has several properties
JobID,Description & StartDate.
The StartDate is Property is defined as follows
public Class Job
private _StartDate as DateTime
public property StartDate() as DateTime
get
return _StartDate
end get
set
_StartDate = value
end set
end property
end class
The problem is when the start date is retreived and displayed
in a datagrid for example, if it has a value of Null(Nothing) the property
returns the value 1/01/0001, is there anyway to return a null value.
Try:
If _StartDate = DateTime.MinValue Then
Return Nothing
Else
Return _StartDate
End If
--
Jos