KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
In an aspx page I am binding the labels like this: <asp:TemplateField HeaderText="Date of Joining"> <ItemTemplate> <asp:Label ID="Label6" runat="server" Text='<%# Eval("date_of_joining") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Paid Priviledge Date"> <ItemTemplate> <asp:Label ID="Label8" runat="server" Text='<%# Eval("paid_priviledge_date") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> And in the code behind I'm binding the grid view like this :(minimum code is given) GridView1.DataSource = dt2; GridView1.DataBind(); But the gridview columns show the date like this : 4/12/2011 12:00:00 AM 4/4/2011 12:00:00 AM Please suggest how to remove the time stamp part and to display only the date part. I know how to do this by formatting using ToString and SubString. But I am not able to do this in gridview.
Tags (comma-separated)
Save Edits
Cancel