D
Douglas J. Badin
I have a DataGrid with which formats dates
<ASP:TEMPLATECOLUMN SortExpression="EST_DATE" HeaderText="Est Date">
<ITEMTEMPLATE>
<ASP:LABEL runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.EST_DATE", "{0:d}") %>'></ASP:LABEL>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>
If the value is null, a   is not generated, hence in Netscape the table
cell is no rendered correctly.
The only workaround I have found is to use the ?: operator or call a
procedure to check for "" and replace it with " " like:
EmptyStringCheck(DataBinder.Eval(Container, "DataItem.EST_DATE", "{0:d}"))
1. Is there a way to make the DataGrid do this like it does when a
formatting is not used?
2. Is there a conditional formatString that if "" then " ", like the ?:
operator?
3. I tried checking in PreRender, but the TableCell.Text was still "" for
null and non-null values. So when does Formatting take place in the control
life cycle?
WindowsForms has a NullText property but I couldn't find something similar
for WebForms.
Thanks,
Doug
<ASP:TEMPLATECOLUMN SortExpression="EST_DATE" HeaderText="Est Date">
<ITEMTEMPLATE>
<ASP:LABEL runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.EST_DATE", "{0:d}") %>'></ASP:LABEL>
</ITEMTEMPLATE>
</ASP:TEMPLATECOLUMN>
If the value is null, a   is not generated, hence in Netscape the table
cell is no rendered correctly.
The only workaround I have found is to use the ?: operator or call a
procedure to check for "" and replace it with " " like:
EmptyStringCheck(DataBinder.Eval(Container, "DataItem.EST_DATE", "{0:d}"))
1. Is there a way to make the DataGrid do this like it does when a
formatting is not used?
2. Is there a conditional formatString that if "" then " ", like the ?:
operator?
3. I tried checking in PreRender, but the TableCell.Text was still "" for
null and non-null values. So when does Formatting take place in the control
life cycle?
WindowsForms has a NullText property but I couldn't find something similar
for WebForms.
Thanks,
Doug