PC Review


Reply
Thread Tools Rate Thread

Datagrid field settings

 
 
Sebastian Santacroce
Guest
Posts: n/a
 
      2nd Oct 2003
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


 
Reply With Quote
 
 
 
 
scorpion53061
Guest
Posts: n/a
 
      3rd Oct 2003
Lot better experts than me but Try
myGridTextBoxColumn = Format(Date.Now, "hh:mm:ss")

"Sebastian Santacroce" <(E-Mail Removed)> wrote in message
news:058101c38916$60636b80$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
copy field settings of a field to other fields in same pivot tbl new22007 Microsoft Excel Worksheet Functions 0 8th May 2008 10:22 PM
Unable to change field settings in calculated field in a pivot tab =?Utf-8?B?TWlrZQ==?= Microsoft Excel Misc 1 26th Sep 2006 05:26 AM
Settings values in DataGrid =?Utf-8?B?Um9uYWxkIE1vcmFsZXM=?= Microsoft C# .NET 1 27th Oct 2004 03:28 PM
datagrid settings David Setiawan via .NET 247 Microsoft Dot NET Framework Forms 1 12th Jun 2004 07:29 PM
Re: datagrid with TextBox as field.....problem in setting as password field Claes Bergefall Microsoft Dot NET Framework Forms 0 3rd Jul 2003 12:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:01 AM.