Formatting date in DataGrid

R

Richard Keller

How can I format a date or number in a data grid.
If I want to show a date as "dd/MM/yy" and the column is
set up as a DateTime datatype, how can I have the date
show up in the format I want?
 
K

Ken Tucker [MVP]

Hi,

Dim cm As CurrencyManager = CType(Me.BindingContext(dvClient),
CurrencyManager)

Dim pd As PropertyDescriptor = cm.GetItemProperties()("AppointDate")

Dim colDate As New DataGridTextBoxColumn(pd, "dd/MM/yy")

With colDate

..MappingName = "ApointDate"

..HeaderText = "Date"

..Width = 100

End With



Ken
 

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

Top