By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,041 Members | 1,056 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,041 IT Pros & Developers. It's quick & easy.

DateTime value as just Time on DataGrid

P: n/a
How do I setup the DataGridTextBoxColumn object so that a
DateTime variable only shows the time portion?
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Set your formatting string to be {0:t} I believe... hang on lemme check
that...

<pause while I look>

Yes.. thats right

So, your textbox .text field would be
String.Format("{0:t}",
myDateTimeFieldMemberValueInfoMemberValueDotcomDot Org)

Look up DataTimeFormatInfo class (seriously) and it will show you all the
formatting patterns

-CJ

"Sean" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
How do I setup the DataGridTextBoxColumn object so that a
DateTime variable only shows the time portion?

Nov 20 '05 #2

P: n/a
How do I apply that to a DataGridTextBoxColumn?

Dim dgtbc_StartTime as New DataGridTextBoxColumn

dgtbc_StartTime.Format = "{0:t}"

doesn't work right. I was using:

Dim ltpPattern As New
System.Globalization.DateTimeFormatInfo

dgtbc_StartTime.Format = ltpPattern.LongTimePattern

but that strips the AM/PM off of my time.

Thanks

-----Original Message-----
Set your formatting string to be {0:t} I believe... hang on lemme checkthat...

<pause while I look>

Yes.. thats right

So, your textbox .text field would be
String.Format("{0:t}",
myDateTimeFieldMemberValueInfoMemberValueDotcomDo tOrg)

Look up DataTimeFormatInfo class (seriously) and it will show you all theformatting patterns

-CJ

"Sean" <an*******@discussions.microsoft.com> wrote in messagenews:04****************************@phx.gbl...
How do I setup the DataGridTextBoxColumn object so that a DateTime variable only shows the time portion?

.

Nov 20 '05 #3

P: n/a
Hmmm... not sure why the second is stripping the AM /PM off it, have you
tried a different format and see what happens? Wish I could give better
advice than that unless you could override on the bidning (like asp.net) and
set it there, but don't knowi f you can.

-CJ
"Sean" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
How do I apply that to a DataGridTextBoxColumn?

Dim dgtbc_StartTime as New DataGridTextBoxColumn

dgtbc_StartTime.Format = "{0:t}"

doesn't work right. I was using:

Dim ltpPattern As New
System.Globalization.DateTimeFormatInfo

dgtbc_StartTime.Format = ltpPattern.LongTimePattern

but that strips the AM/PM off of my time.

Thanks

-----Original Message-----
Set your formatting string to be {0:t} I believe... hang

on lemme check
that...

<pause while I look>

Yes.. thats right

So, your textbox .text field would be
String.Format("{0:t}",
myDateTimeFieldMemberValueInfoMemberValueDotcomDo tOrg)

Look up DataTimeFormatInfo class (seriously) and it will

show you all the
formatting patterns

-CJ

"Sean" <an*******@discussions.microsoft.com> wrote in

message
news:04****************************@phx.gbl...
How do I setup the DataGridTextBoxColumn object so that a DateTime variable only shows the time portion?

.

Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.