DateTime field on DataGrid

G

Guest

Hi all
I have an Access Data Base containing a table which have a DateTime Field. I am creating a Windows App and I am using a DataGrid object to show data from the table using a DataSet object. My problem is that the column showing the DateTime field shows the data with the format dd/MM/yyyy but I want to show the format dd/MM/yyyy HH/mm
The Field on the DataBase is defined as DateTime with the format dd/MM/yyyy HH:mm. Also I have created the DataSet by code
Please, could anyone let me know how can I change the format of column on a DataGrid (programmatically)?
Many Thanks
Marcos
 
C

Cor

Hi Marcos,

Some links mostly people find it there.

Faqs
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/datagrid.mspx

http://msdn.microsoft.com/library/d...ry/en-us/dnwinforms/html/wnf_CustDataGrid.asp

http://msdn.microsoft.com/library/d...ormsdatagridtextboxcolumnclassformattopic.asp

I hope this helps a little bit?

Cor
I have an Access Data Base containing a table which have a DateTime Field.
I am creating a Windows App and I am using a DataGrid object to show data
from the table using a DataSet object. My problem is that the column showing
the DateTime field shows the data with the format dd/MM/yyyy but I want to
show the format dd/MM/yyyy HH/mm.
The Field on the DataBase is defined as DateTime with the format
dd/MM/yyyy HH:mm. Also I have created the DataSet by code.
Please, could anyone let me know how can I change the format of column on
a DataGrid (programmatically)?.
 
M

Miha Markic [MVP C#]

Hi Marcos,

Check out Binding.Format event in .net help files.

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com

Marcos Rodríguez said:
Hi all,
I have an Access Data Base containing a table which have a DateTime Field.
I am creating a Windows App and I am using a DataGrid object to show data
from the table using a DataSet object. My problem is that the column showing
the DateTime field shows the data with the format dd/MM/yyyy but I want to
show the format dd/MM/yyyy HH/mm.
The Field on the DataBase is defined as DateTime with the format
dd/MM/yyyy HH:mm. Also I have created the DataSet by code.
Please, could anyone let me know how can I change the format of column on
a DataGrid (programmatically)?.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

date time formatting 3
DateTime sql server - sqldataadapter 2
String to DateTime 1
DateTime format 3
TextBox formatting 1
convert date 1
Sqldatasource Update 1
DateTIme help 2

Top