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

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top