I tryed to apply this to what I have but it did not do
anything. Heres the code I used in reference to my first
email trying to merge with your code.
'ds is the dataSet
'StartTime is the field column name I want as time not
date.
Please clarify were I went wrong.
Thank you.
Dim cm As CurrencyManager = CType(Me.Bindin gContext(ds),
CurrencyManager )
Dim pd As System.Componen tModel.Property Descriptor
= cm.GetItemPrope rties()("StartT ime")
Dim colDate As New DataGridTextBox Column(pd, "t")
With colDate
.MappingName = "StartTime"
.HeaderText = "StartTime"
.Width = 100
End With
-----Original Message-----
Hi,
Dim cm As CurrencyManager = CType(Me.Bindin gContext
(dvClient),CurrencyManage r)
Dim pd As PropertyDescrip tor = cm.GetItemPrope rties()
("AppointDat e")
Dim colDate As New DataGridTextBox Column(pd, "t")
With colDate
..MappingNam e = "ApointDate "
..HeaderText = "Date"
..Width = 100
End With
Ken
---------------------
"Sebastian Santacroce" <ss*********@il ogic.com> wrote in
messagenews:00******* *************** ******@phx.gbl. .. I'm trying to format datetime column in datagrid to a
time format rather than date. I'm using code:
Dim myGridTextBoxCo lumn As DataGridTextBox Column = New
DataGridTextBox Column()
myGridTextBoxCo lumn = CType(datagrid. TableStyles
(0).GridColumnS tyles("StartDat e"),
DataGridTextBox Column)
myGridTextBoxCo lumn.Format="hh :mm:ss tt"
However, that last line always give error"Object
reference not set to an instance of an object."
What am I doing wrong?
Thank you
Sebastian
.