I
irene
Hi, I am displaying a datagrid on my webpage and it is linking to a
dataset. There is a datetime value from the dataset showing on the
webpage(datagrid) as full date format, like "10/27/2004 12:00:00 AM".
How can I convert them to shortdate format '10/27/2004'? Before I was
using sth like:
<asp:TemplateColumn HeaderText="Course Start Date">
<ItemTemplate>
<asp:Label text = '<%#
DateTime.Parse(Container.dataItem("CD_Date")).toString("D") %>' ID =
"lblStartDate" Runat =server/>
</ItemTemplate>
</asp:TemplateColumn>
But now I wonder whether there is an easy way to do it other than that
because the datagrid is linking to a dataset directly and I dont need
to add those Itemtemplate anymore.
Can anyone help me?
Thanks.
Irene
dataset. There is a datetime value from the dataset showing on the
webpage(datagrid) as full date format, like "10/27/2004 12:00:00 AM".
How can I convert them to shortdate format '10/27/2004'? Before I was
using sth like:
<asp:TemplateColumn HeaderText="Course Start Date">
<ItemTemplate>
<asp:Label text = '<%#
DateTime.Parse(Container.dataItem("CD_Date")).toString("D") %>' ID =
"lblStartDate" Runat =server/>
</ItemTemplate>
</asp:TemplateColumn>
But now I wonder whether there is an easy way to do it other than that
because the datagrid is linking to a dataset directly and I dont need
to add those Itemtemplate anymore.
Can anyone help me?
Thanks.
Irene