C
cindy
I have datagrid, datasource datafield is datetime so its
ugly date time etc ugly I want short date
in datagrid column is datetime datatype so it sorts right
not like text so thats good but its ugly
have tried this but the error is invalid cast
<asp:TemplateColumn SortExpression="reviseddate" HeaderText="Revised Date">
<ItemTemplate><asp:Label runat="server" Text='<%#
((DateTime)DataBinder.Eval(Container.DataItem,
"reviseddate")).ToShortDateString() %>' ID="Label2"></asp:Label>
</ItemTemplate>
have tried this but then the grid just does not display it binds and then
cannot display
the code below was auto created, as a bound column the use of
dataformatstring
works great then using property builder in design mode and convert to
template
column you get code below but then run and no grid display
<ItemTemplate><asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.reviseddate", "{0:d}") %>'></asp:Label></ItemTemplate>
ugly date time etc ugly I want short date
in datagrid column is datetime datatype so it sorts right
not like text so thats good but its ugly
have tried this but the error is invalid cast
<asp:TemplateColumn SortExpression="reviseddate" HeaderText="Revised Date">
<ItemTemplate><asp:Label runat="server" Text='<%#
((DateTime)DataBinder.Eval(Container.DataItem,
"reviseddate")).ToShortDateString() %>' ID="Label2"></asp:Label>
</ItemTemplate>
have tried this but then the grid just does not display it binds and then
cannot display
the code below was auto created, as a bound column the use of
dataformatstring
works great then using property builder in design mode and convert to
template
column you get code below but then run and no grid display
<ItemTemplate><asp:Label runat="server" Text='<%# DataBinder.Eval(Container,
"DataItem.reviseddate", "{0:d}") %>'></asp:Label></ItemTemplate>