S
Simon Harvey
Hi all,
I'm having problems getting my date to format. Someone told me that with
the GridView, you need to use a TemplateColumn and not a BoundColumn when
displaying dates.
Given that, can anyone see what the problem is with the following code....
<asp:TemplateField HeaderText="Departure Date">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DepartDate",
"{0:dd-mm-yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
When it comes to rendering, the grid continues to display the full date and
time. It's as though it's just ignoring the date formatting instruction.
Can anyone tell me why.
I'd be very grateful if anyone could help
Thanks
Simon
I'm having problems getting my date to format. Someone told me that with
the GridView, you need to use a TemplateColumn and not a BoundColumn when
displaying dates.
Given that, can anyone see what the problem is with the following code....
<asp:TemplateField HeaderText="Departure Date">
<ItemTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Bind("DepartDate",
"{0:dd-mm-yyyy}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
When it comes to rendering, the grid continues to display the full date and
time. It's as though it's just ignoring the date formatting instruction.
Can anyone tell me why.
I'd be very grateful if anyone could help
Thanks
Simon