473,397 Members | 1,972 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,397 software developers and data experts.

Date and time in Datagrids

Hello,

I have some fields in the dataset that bear date and time values. When I
bind the datagrid the time part of the fields don't show.
Is it possible to format the datagrid columns so that they show the whole
thing?

Thanks
May 5 '06 #1
4 1214
Hi,

What kind of grid are you using? (win or web) ?
How are you binding it?

If a web based you can use a template column and format it as you want :

<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center" Width="12%"></ItemStyle>
<ItemTemplate>
<span><%# Container.DataItem("INC_UPDATEDATETIME") %></span>
</ItemTemplate>
</asp:TemplateColumn>
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP05.phx.gbl...
Hello,

I have some fields in the dataset that bear date and time values. When I
bind the datagrid the time part of the fields don't show.
Is it possible to format the datagrid columns so that they show the whole
thing?

Thanks

May 5 '06 #2
Dan,

What you need to do is get the DataGridTextBoxColumn instance for the
date column, and set the Format property to the format that you want the
date to be shown in.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP05.phx.gbl...
Hello,

I have some fields in the dataset that bear date and time values. When I
bind the datagrid the time part of the fields don't show.
Is it possible to format the datagrid columns so that they show the whole
thing?

Thanks

May 5 '06 #3
Thanks Ignacio for the reply.
Sorry I wasn't more specific. It is a Windows datagrid.
I use DataSource property to bind to the DataSet

"Ignacio Machin ( .NET/ C# MVP )" <ignacio.machin AT dot.state.fl.us> wrote
in message news:uu**************@TK2MSFTNGP03.phx.gbl...
Hi,

What kind of grid are you using? (win or web) ?
How are you binding it?

If a web based you can use a template column and format it as you want :

<asp:TemplateColumn>
<ItemStyle HorizontalAlign="Center" Width="12%"></ItemStyle>
<ItemTemplate>
<span><%# Container.DataItem("INC_UPDATEDATETIME") %></span>
</ItemTemplate>
</asp:TemplateColumn>
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP05.phx.gbl...
Hello,

I have some fields in the dataset that bear date and time values. When I
bind the datagrid the time part of the fields don't show.
Is it possible to format the datagrid columns so that they show the whole
thing?

Thanks


May 5 '06 #4
Thanks Nicholas for the answer. Is it valid for Windows Datagrid?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:uL**************@TK2MSFTNGP03.phx.gbl...
Dan,

What you need to do is get the DataGridTextBoxColumn instance for the
date column, and set the Format property to the format that you want the
date to be shown in.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dan Aldean" <da*******@yahoo.com> wrote in message
news:uL**************@TK2MSFTNGP05.phx.gbl...
Hello,

I have some fields in the dataset that bear date and time values. When I
bind the datagrid the time part of the fields don't show.
Is it possible to format the datagrid columns so that they show the whole
thing?

Thanks


May 5 '06 #5

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

Similar topics

1
by: | last post by:
In SQL Server Query Analyzer, if I type in, say, 2 select queries, it returns 2 datagrids of results, with a scrollbar on the right to scroll between the 2 (or more) datagrids. I wanted to...
1
by: Simon Harris | last post by:
Hi All, I wish to populate more than one datagrid from the same OleDBCommand. The code I have is: Dim objCmd As New OleDbCommand(strSql, objConn) Then... ...
4
by: ree32 | last post by:
I have a placeholder and depending on a user input(a drop downlist) when the user clicks a button I dynamically create a number of datagrids and fill them with data from a database. But the problem...
0
by: Scott Meddows | last post by:
I'm having trouble scrolling some datagrids so they sync up... I have two identical datagrids on a form, filled with eh same dataset. I want a user to be able to scroll on the datasets and the...
4
by: | last post by:
Hello. In SQL Server Query Analyzer, if I type in, say, 2 select queries, it returns 2 datagrids of results, with a scrollbar on the right to scroll between the 2 (or more) datagrids. I wanted to...
3
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
0
by: Jim | last post by:
OK here's my disclaimer: I'm very new to ASP.NET and posting on Google Groups, so please bear with me and feel free to correct either the way I code or the way I post. I have an ASP.NET page...
1
by: =?Utf-8?B?Sm9obiBXYWxrZXI=?= | last post by:
Hi, I am using the code below to export a webpage to Excel. The webpage has three datagrids on it and they are all exported to Excel properly and everything looks very nice, but we would really...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...

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.