Formatting Values in DataGrid Control

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
You can use the ItemDataBound event
and set e.Item.Cells[ColumnNumber].Text to the format you want.

Shimon.
 
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

Back
Top