DataGrid Binding Format in .NET 1.1

mafrosis

Well-known member
Joined
Jun 5, 2006
Messages
88
Location
UK
Programming Experience
5-10
Ive got to work in .NET 1.1 for this project, so bear that in mind when you read this:

Ive got a DataTable bound to a DataGrid and one of the columns has data which needs processing before it is displayed in the grid. Essentially it is a timestamp (a number of seconds) which I need to convert into a real date/time.

This cannot be done via the DataGridTextBoxColumn Format property because the timestamp is constructed as a count from 0 to 4800 (80 mins) inside the application.

I suppose kind of what I am after is like the Format() method on a Binding object..

Is this possible, or am I going to have to change stuff so I store all my timestamps as date objects?

Cheers
mafro
 
can it be done using an expression property? Failing that, whats wrong with putting the logic in the sql?
 
Just incase anyone ever stumbles across this post in the future - I solved it with a rather simple answer in the end..

I created an additional column in my dataset which was of type String, then format my seconds count using my own method, and stick it into this column.

The integer timestamp gets written back to the database, and the String formatted time column is bound to the datagrid on screen.

Dont know how it took me so long to figure out that one.. :confused: doh
 
Back
Top