473,410 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

Datagrid Formatting

Hello

I have a datagrid bound to a dataset which is filled with
a table with datetime fields.
The datagrid displays them as '26-12-2003' instead of '26-
12-2003 20:00:00'.

I've checked the type of GridColumnStyles of the 2
columns and they are both DataGridTextBoxColumn.

How do i change it so the date are correctly displayed?

Thanks
Kind regars
Jorge Cavalheiro
Nov 20 '05 #1
3 1580
Hi,

Add a tablestyle to your grid.
http://msdn.microsoft.com/library/de...asicprimer.asp

Ken
--------------
"Jorge Cavalheiro" <an*******@discussions.microsoft.com> wrote in message
news:03****************************@phx.gbl...
Hello

I have a datagrid bound to a dataset which is filled with
a table with datetime fields.
The datagrid displays them as '26-12-2003' instead of '26-
12-2003 20:00:00'.

I've checked the type of GridColumnStyles of the 2
columns and they are both DataGridTextBoxColumn.

How do i change it so the date are correctly displayed?

Thanks
Kind regars
Jorge Cavalheiro

Nov 20 '05 #2
Can't you use the Format property of the DataGridTextBoxColumn? This should
do the trick!

--
Greetz,
Jan
__________________________________
Read my weblog: http://weblogs.asp.net/jan
"Jorge Cavalheiro" <an*******@discussions.microsoft.com> schreef in bericht
news:03****************************@phx.gbl...
Hello

I have a datagrid bound to a dataset which is filled with
a table with datetime fields.
The datagrid displays them as '26-12-2003' instead of '26-
12-2003 20:00:00'.

I've checked the type of GridColumnStyles of the 2
columns and they are both DataGridTextBoxColumn.

How do i change it so the date are correctly displayed?

Thanks
Kind regars
Jorge Cavalheiro

Nov 20 '05 #3
Cor
Hi Jorge,

I saw this once in this newsgroup

You can set the dateformat from a datagridtextboxcolumn.
I did not check how to do it in your case

http://msdn.microsoft.com/library/de...ormattopic.asp

I hope this helps?

Cor
I have a datagrid bound to a dataset which is filled with
a table with datetime fields.
The datagrid displays them as '26-12-2003' instead of '26-
12-2003 20:00:00'.

I've checked the type of GridColumnStyles of the 2
columns and they are both DataGridTextBoxColumn.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frnak McKenney | last post by:
One of the reasons given for the Allied victory in WWI is that the Nazi armament industry invested so much effort in creating new weapons (e.g. the jet plane) it wasn't able to develop any of them...
7
by: Matthew Wieder | last post by:
Hi - I have a datagrid that has a black header and the rows alternate white and gray. The problem is that until items are added to the grid, the grid appears as a large black rectangle, which is...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
2
by: Sebi | last post by:
Hello all is it possible to add a checkbox in a DataGrid for Boolean Data? Thanks in advance
3
by: McNutt Consulting | last post by:
I'm trying to implement a datagrid with dynamically created columns. The data is coming out of a very simple XML file, and it's bound through a dataview. The datagrid is just a shell definition...
5
by: tshad | last post by:
I have been trying to figure out what the Datagrid is doing to create its formatting. I found that some of my Datagrids have a 3D type of border and sometime it has a straight line. I finally...
5
by: cwbp17 | last post by:
Hi all, Have a datagrid that displays the price column of a table. Went to the Datagrid's Property builder and set the 'Data Formatting expression' for the PRICE column to {0:c}, so that the...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
2
by: DraguVaso | last post by:
Hi, I'm looking for a nice way to format the cell of my datagrid according to some predefined 'rules'. I found a lot on the site of George shepherd, but it wasn't really what I was looking for:...
1
by: Michael Calvin | last post by:
Some basic things I cannot figure out how to do with new datagrid. 1) How do I control the formatting of the column header separately from the rest of the column? 2) If I align right the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.