are you sure they are nulls or just empty data fields. (In my experience
"nulls" crash things if you haven't specifically coded around them) Either
way, you should be able to define a function that you can put in your
databinding syntax <%# %> or in your itemdatabound event that will give you
the date you want. Your function would be something like this.
Private Function getDate(ByVal myDate As Object) As String
getDate = CStr(myDate)
If getDate = "1/1/0001" Then
getDate = String.Empty
End If
Return getDate
End Function
then in your datagrid, define a templatecolumn for this column
<asp:templateco lumn headertext="Dat e">
<itemtemplate >
<%# getDate(DataBin der.Eval(Contai ner.DataItem, "myDate")) %>
</itemtemplate>
</asp:templatecol umn>
hope this helps
--Michael
"Reza" <uw******@hotma il.com> wrote in message
news:F6******** *************** ***********@mic rosoft.com...
Hi,
I have a column in my datagrid that can have values of null at times. I am
not assigning any value to it, if it is coming from Database empty. Now, the
problem is I guess the datetime variables have a default value. Thus shows
an undesirable value of 1/1/0001.
How do I go about not showing anything when the value is null like this?
Thanks in advance,
Reza