Click here to Skip to main content
15,891,657 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: A field or property with the name ... was not found on the selected data source Pin
kubben20-Feb-07 8:30
kubben20-Feb-07 8:30 
QuestionIframe Issue Pin
Amit Kumar G20-Feb-07 7:48
Amit Kumar G20-Feb-07 7:48 
AnswerRe: Iframe Issue Pin
adnanrafiq20-Feb-07 8:25
adnanrafiq20-Feb-07 8:25 
GeneralRe: Iframe Issue Pin
Amit Kumar G20-Feb-07 11:37
Amit Kumar G20-Feb-07 11:37 
Questionformatting date in gridview [modified] Pin
Kunal P20-Feb-07 5:07
Kunal P20-Feb-07 5:07 
AnswerRe: formatting date in gridview Pin
kubben20-Feb-07 5:56
kubben20-Feb-07 5:56 
QuestionRe: formatting date in gridview Pin
Kunal P22-Feb-07 1:26
Kunal P22-Feb-07 1:26 
AnswerRe: formatting date in gridview Pin
kubben22-Feb-07 2:01
kubben22-Feb-07 2:01 
In the gridview. You need to convert the column you want the date in to be an ItemTemplate. In the ItemTemplate you need a Label control. In the Text property of the Label control you need to put the this:
<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>

The page load event is not the correct place to put this code.

So if you look at your gridview in the HTML mode you will find the <Columns> node
YOu need code like this:
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lbDate" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"Date").ToString("dd/MMM/yyyy") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>

NOTE the Date that comes right after the Container.DataItem is what ever your are calling your date field.

Hope that helps.
Ben
GeneralRe: formatting date in gridview Pin
Kunal P22-Feb-07 4:55
Kunal P22-Feb-07 4:55 
GeneralRe: formatting date in gridview Pin
kubben22-Feb-07 7:33
kubben22-Feb-07 7:33 
QuestionRe: formatting date in gridview Pin
Kunal P23-Feb-07 2:42
Kunal P23-Feb-07 2:42 
AnswerRe: formatting date in gridview Pin
kubben23-Feb-07 3:02
kubben23-Feb-07 3:02 
QuestionRe: formatting date in gridview Pin
Kunal P23-Feb-07 3:09
Kunal P23-Feb-07 3:09 
AnswerRe: formatting date in gridview Pin
kubben23-Feb-07 3:11
kubben23-Feb-07 3:11 
Generaldone...finally Pin
Kunal P23-Feb-07 3:21
Kunal P23-Feb-07 3:21 
GeneralRe: done...finally Pin
kubben23-Feb-07 3:22
kubben23-Feb-07 3:22 
GeneralRe: done...finally Pin
Kunal P23-Feb-07 3:23
Kunal P23-Feb-07 3:23 
GeneralRe: done...finally Pin
kubben23-Feb-07 3:30
kubben23-Feb-07 3:30 
QuestionFileUpload Web Control is not working with Atlas Pin
Rajesh_K_Sharma20-Feb-07 4:39
Rajesh_K_Sharma20-Feb-07 4:39 
AnswerRe: FileUpload Web Control is not working with Atlas Pin
badgrs20-Feb-07 5:54
badgrs20-Feb-07 5:54 
GeneralRe: FileUpload Web Control is not working with Atlas Pin
Jon Sagara20-Feb-07 6:30
Jon Sagara20-Feb-07 6:30 
QuestionCells(2).Text returns an empty string Pin
Hampden Tech20-Feb-07 3:37
Hampden Tech20-Feb-07 3:37 
AnswerRe: Cells(2).Text returns an empty string Pin
kubben20-Feb-07 3:52
kubben20-Feb-07 3:52 
GeneralRe: Cells(2).Text returns an empty string Pin
Hampden Tech20-Feb-07 3:54
Hampden Tech20-Feb-07 3:54 
GeneralRe: Cells(2).Text returns an empty string Pin
kubben20-Feb-07 3:59
kubben20-Feb-07 3:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.