Datagrid field settings

  • Thread starter Thread starter Sebastian Santacroce
  • Start date Start date
S

Sebastian Santacroce

I'm trying to format datetime column in datagrid to a time
format rather than date. I'm using code:

Dim myGridTextBoxColumn As DataGridTextBoxColumn = New
DataGridTextBoxColumn()

myGridTextBoxColumn = CType(datagrid.TableStyles
(0).GridColumnStyles("StartDate"), DataGridTextBoxColumn)

myGridTextBoxColumn.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
 
Lot better experts than me but Try
myGridTextBoxColumn = Format(Date.Now, "hh:mm:ss")
 
Back
Top