Formatting Values in DataGrid Control

G

Guest

If I have a DateTime column in my DataGrid conrol, and it's bound to an
OleDbDataReader, how can I format the returned data the way I want it
formatted and displayed in that column?

Alex
 
S

SKC

You can use the ItemDataBound event
and set e.Item.Cells[ColumnNumber].Text to the format you want.

Shimon.
 
K

K B

Set your DataFormatString for the date column to {0:d} -- that's a zero
not an O.

HTH,
Kit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top